test/common.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 09 Mar 2011 15:09:00 -0800
changeset 5459 881d1e03e381
parent 5147 ad50b3db78bd
child 5517 aa339c0dca2d
permissions -rw-r--r--
Fixed touches for the !IPHONE_TOUCH_EFFICIENT_DANGEROUS case
     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     const char *window_icon;
    28     Uint32 window_flags;
    29     int window_x;
    30     int window_y;
    31     int window_w;
    32     int window_h;
    33     int depth;
    34     int refresh_rate;
    35     int num_windows;
    36     SDL_Window **windows;
    37 
    38     /* Renderer info */
    39     const char *renderdriver;
    40     Uint32 render_flags;
    41     SDL_bool skip_renderer;
    42     SDL_Renderer **renderers;
    43 
    44     /* Audio info */
    45     const char *audiodriver;
    46     SDL_AudioSpec audiospec;
    47 
    48     /* GL settings */
    49     int gl_red_size;
    50     int gl_green_size;
    51     int gl_blue_size;
    52     int gl_alpha_size;
    53     int gl_buffer_size;
    54     int gl_depth_size;
    55     int gl_stencil_size;
    56     int gl_double_buffer;
    57     int gl_accum_red_size;
    58     int gl_accum_green_size;
    59     int gl_accum_blue_size;
    60     int gl_accum_alpha_size;
    61     int gl_stereo;
    62     int gl_multisamplebuffers;
    63     int gl_multisamplesamples;
    64     int gl_retained_backing;
    65     int gl_accelerated;
    66     int gl_major_version;
    67     int gl_minor_version;
    68 } CommonState;
    69 
    70 extern CommonState *CommonCreateState(char **argv, Uint32 flags);
    71 extern int CommonArg(CommonState * state, int index);
    72 extern const char *CommonUsage(CommonState * state);
    73 extern SDL_bool CommonInit(CommonState * state);
    74 extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
    75 extern void CommonQuit(CommonState * state);
    76 
    77 /* vi: set ts=4 sw=4 expandtab: */