test/common.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 19 Jan 2011 22:20:44 -0800
changeset 5046 4cb778067834
parent 4527 3ce59cbecaa3
child 5147 ad50b3db78bd
permissions -rw-r--r--
Clearing the API changes for the 1.3.0 release
     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 
    43     /* Audio info */
    44     const char *audiodriver;
    45     SDL_AudioSpec audiospec;
    46 
    47     /* GL settings */
    48     int gl_red_size;
    49     int gl_green_size;
    50     int gl_blue_size;
    51     int gl_alpha_size;
    52     int gl_buffer_size;
    53     int gl_depth_size;
    54     int gl_stencil_size;
    55     int gl_double_buffer;
    56     int gl_accum_red_size;
    57     int gl_accum_green_size;
    58     int gl_accum_blue_size;
    59     int gl_accum_alpha_size;
    60     int gl_stereo;
    61     int gl_multisamplebuffers;
    62     int gl_multisamplesamples;
    63     int gl_retained_backing;
    64     int gl_accelerated;
    65     int gl_major_version;
    66     int gl_minor_version;
    67 } CommonState;
    68 
    69 extern CommonState *CommonCreateState(char **argv, Uint32 flags);
    70 extern int CommonArg(CommonState * state, int index);
    71 extern const char *CommonUsage(CommonState * state);
    72 extern SDL_bool CommonInit(CommonState * state);
    73 extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
    74 extern void CommonQuit(CommonState * state);
    75 
    76 /* vi: set ts=4 sw=4 expandtab: */