test/common.h
author Paul Hunkin <paul@bieh.net>
Mon, 17 May 2010 15:14:34 +1200
changeset 4695 b7918263da92
parent 3685 64ce267332c6
child 4527 3ce59cbecaa3
permissions -rw-r--r--
Initial commit, adding __ANDROID__ to the platform list
     1 
     2 /* A simple test program framework */
     3 
     4 #define SDL_NO_COMPAT
     5 #include "SDL.h"
     6 
     7 #define DEFAULT_WINDOW_WIDTH  640
     8 #define DEFAULT_WINDOW_HEIGHT 480
     9 
    10 #define VERBOSE_VIDEO   0x00000001
    11 #define VERBOSE_MODES   0x00000002
    12 #define VERBOSE_RENDER  0x00000004
    13 #define VERBOSE_EVENT   0x00000008
    14 #define VERBOSE_AUDIO   0x00000010
    15 
    16 typedef struct
    17 {
    18     /* SDL init flags */
    19     char **argv;
    20     Uint32 flags;
    21     Uint32 verbose;
    22 
    23     /* Video info */
    24     const char *videodriver;
    25     int display;
    26     const char *window_title;
    27     Uint32 window_flags;
    28     int window_x;
    29     int window_y;
    30     int window_w;
    31     int window_h;
    32     int depth;
    33     int refresh_rate;
    34     int num_windows;
    35     SDL_Window **windows;
    36 
    37     /* Renderer info */
    38     const char *renderdriver;
    39     Uint32 render_flags;
    40     SDL_bool skip_renderer;
    41 
    42     /* Audio info */
    43     const char *audiodriver;
    44     SDL_AudioSpec audiospec;
    45 
    46     /* GL settings */
    47     int gl_red_size;
    48     int gl_green_size;
    49     int gl_blue_size;
    50     int gl_alpha_size;
    51     int gl_buffer_size;
    52     int gl_depth_size;
    53     int gl_stencil_size;
    54     int gl_double_buffer;
    55     int gl_accum_red_size;
    56     int gl_accum_green_size;
    57     int gl_accum_blue_size;
    58     int gl_accum_alpha_size;
    59     int gl_stereo;
    60     int gl_multisamplebuffers;
    61     int gl_multisamplesamples;
    62     int gl_retained_backing;
    63     int gl_accelerated;
    64     int gl_major_version;
    65     int gl_minor_version;
    66 } CommonState;
    67 
    68 extern CommonState *CommonCreateState(char **argv, Uint32 flags);
    69 extern int CommonArg(CommonState * state, int index);
    70 extern const char *CommonUsage(CommonState * state);
    71 extern SDL_bool CommonInit(CommonState * state);
    72 extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
    73 extern void CommonQuit(CommonState * state);
    74 
    75 /* vi: set ts=4 sw=4 expandtab: */