test/common.h
changeset 1914 051df511279c
child 1933 7ee5297340f7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/common.h	Tue Jul 18 07:49:51 2006 +0000
     1.3 @@ -0,0 +1,47 @@
     1.4 +
     1.5 +/* A simple test program framework */
     1.6 +
     1.7 +#include "SDL.h"
     1.8 +
     1.9 +#define VERBOSE_VIDEO   0x00000001
    1.10 +#define VERBOSE_MODES   0x00000002
    1.11 +#define VERBOSE_RENDER  0x00000004
    1.12 +#define VERBOSE_EVENT   0x00000008
    1.13 +#define VERBOSE_AUDIO   0x00000010
    1.14 +
    1.15 +typedef struct
    1.16 +{
    1.17 +    /* SDL init flags */
    1.18 +    char **argv;
    1.19 +    Uint32 flags;
    1.20 +    Uint32 verbose;
    1.21 +
    1.22 +    /* Video info */
    1.23 +    const char *videodriver;
    1.24 +    int display;
    1.25 +    const char *window_title;
    1.26 +    Uint32 window_flags;
    1.27 +    int window_x;
    1.28 +    int window_y;
    1.29 +    int window_w;
    1.30 +    int window_h;
    1.31 +    int depth;
    1.32 +    int refresh_rate;
    1.33 +    int num_windows;
    1.34 +    SDL_WindowID *windows;
    1.35 +
    1.36 +    /* Renderer info */
    1.37 +    const char *renderdriver;
    1.38 +    Uint32 render_flags;
    1.39 +
    1.40 +    /* Audio info */
    1.41 +    const char *audiodriver;
    1.42 +    SDL_AudioSpec audiospec;
    1.43 +} CommonState;
    1.44 +
    1.45 +extern CommonState *CommonCreateState(char **argv, Uint32 flags);
    1.46 +extern int CommonArg(CommonState * state, int index);
    1.47 +extern const char *CommonUsage(CommonState * state);
    1.48 +extern SDL_bool CommonInit(CommonState * state);
    1.49 +extern void CommonEvent(CommonState * state, SDL_Event * event, int *done);
    1.50 +extern void CommonQuit(CommonState * state);