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