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