My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Functions
SDL_test_common.h File Reference
#include "SDL.h"
#include "begin_code.h"
#include "close_code.h"

Go to the source code of this file.

Classes

struct  SDLTest_CommonState
 

Macros

#define DEFAULT_WINDOW_WIDTH   640
 
#define DEFAULT_WINDOW_HEIGHT   480
 
#define VERBOSE_VIDEO   0x00000001
 
#define VERBOSE_MODES   0x00000002
 
#define VERBOSE_RENDER   0x00000004
 
#define VERBOSE_EVENT   0x00000008
 
#define VERBOSE_AUDIO   0x00000010
 

Functions

SDLTest_CommonStateSDLTest_CommonCreateState (char **argv, Uint32 flags)
 Parse command line parameters and create common state. More...
 
int SDLTest_CommonArg (SDLTest_CommonState *state, int index)
 Process one common argument. More...
 
const char * SDLTest_CommonUsage (SDLTest_CommonState *state)
 Returns common usage information. More...
 
SDL_bool SDLTest_CommonInit (SDLTest_CommonState *state)
 Open test window. More...
 
void SDLTest_CommonEvent (SDLTest_CommonState *state, SDL_Event *event, int *done)
 Common event handler for test windows. More...
 
void SDLTest_CommonQuit (SDLTest_CommonState *state)
 Close test window. More...
 

Detailed Description

Include file for SDL test framework.

This code is a part of the SDL2_test library, not the main SDL library.

Function Documentation

int SDLTest_CommonArg ( SDLTest_CommonState state,
int  index 
)

Process one common argument.

Parameters
stateThe common state describing the test window to create.
indexThe index of the argument to process in argv[].
Returns
The number of arguments processed (i.e. 1 for –fullscreen, 2 for –video [videodriver], or -1 on error.
SDLTest_CommonState* SDLTest_CommonCreateState ( char **  argv,
Uint32  flags 
)

Parse command line parameters and create common state.

Parameters
argvArray of command line parameters
flagsFlags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
Returns
Returns a newly allocated common state object.
void SDLTest_CommonEvent ( SDLTest_CommonState state,
SDL_Event event,
int done 
)

Common event handler for test windows.

Parameters
stateThe common state used to create test window.
eventThe event to handle.
doneFlag indicating we are done.
SDL_bool SDLTest_CommonInit ( SDLTest_CommonState state)

Open test window.

Parameters
stateThe common state describing the test window to create.
Returns
True if initialization succeeded, false otherwise
void SDLTest_CommonQuit ( SDLTest_CommonState state)

Close test window.

Parameters
stateThe common state used to create test window.
const char* SDLTest_CommonUsage ( SDLTest_CommonState state)

Returns common usage information.

Parameters
stateThe common state describing the test window to create.
Returns
String with usage information