test/common.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 02 Aug 2009 18:39:57 +0000
changeset 3227 458e53d8662c
parent 3194 c18c03927a77
child 3408 55541ddf13e3
permissions -rw-r--r--
Clarified API documentation
     1 
     2 /* A simple test program framework */
     3 
     4 #include "SDL.h"
     5 
     6 #define DEFAULT_WINDOW_WIDTH  640
     7 #define DEFAULT_WINDOW_HEIGHT 480
     8 
     9 #define VERBOSE_VIDEO   0x00000001
    10 #define VERBOSE_MODES   0x00000002
    11 #define VERBOSE_RENDER  0x00000004
    12 #define VERBOSE_EVENT   0x00000008
    13 #define VERBOSE_AUDIO   0x00000010
    14 
    15 typedef struct
    16 {
    17     /* SDL init flags */
    18     char **argv;
    19     Uint32 flags;
    20     Uint32 verbose;
    21 
    22     /* Video info */
    23     const char *videodriver;
    24     int display;
    25     const char *window_title;
    26     Uint32 window_flags;
    27     int window_x;
    28     int window_y;
    29     int window_w;
    30     int window_h;
    31     int depth;
    32     int refresh_rate;
    33     int num_windows;
    34     SDL_WindowID *windows;
    35 
    36     /* Renderer info */
    37     const char *renderdriver;
    38     Uint32 render_flags;
    39     SDL_bool skip_renderer;
    40 
    41     /* Audio info */
    42     const char *audiodriver;
    43     SDL_AudioSpec audiospec;
    44 } CommonState;
    45 
    46 extern CommonState *CommonCreateState(char **argv, Uint32 flags);
    47 extern int CommonArg(CommonState * state, int index);
    48 extern const char *CommonUsage(CommonState * state);
    49 extern SDL_bool CommonInit(CommonState * state);
    50 extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
    51 extern void CommonQuit(CommonState * state);