World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл SDL_test_common.h

См. исходные тексты.

Классы

struct  SDLTest_CommonState
 

Функции

SDLTest_CommonStateSDLTest_CommonCreateState (char **argv, Uint32 flags)
 Parse command line parameters and create common state. Подробнее...
 
int SDLTest_CommonArg (SDLTest_CommonState *state, int index)
 Process one common argument. Подробнее...
 
void SDLTest_CommonLogUsage (SDLTest_CommonState *state, const char *argv0, const char **options)
 Logs command line usage info. Подробнее...
 
const char * SDLTest_CommonUsage (SDLTest_CommonState *state)
 Returns common usage information. Подробнее...
 
SDL_bool SDLTest_CommonInit (SDLTest_CommonState *state)
 Open test window. Подробнее...
 
SDL_bool SDLTest_CommonDefaultArgs (SDLTest_CommonState *state, const int argc, char **argv)
 Easy argument handling when test app doesn't need any custom args. Подробнее...
 
void SDLTest_CommonEvent (SDLTest_CommonState *state, SDL_Event *event, int *done)
 Common event handler for test windows. Подробнее...
 
void SDLTest_CommonQuit (SDLTest_CommonState *state)
 Close test window. Подробнее...
 

Подробное описание

Include file for SDL test framework.

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

См. определение в файле SDL_test_common.h

Функции

◆ SDLTest_CommonCreateState()

SDLTest_CommonState* SDLTest_CommonCreateState ( char **  argv,
Uint32  flags 
)

Parse command line parameters and create common state.

Аргументы
argvArray of command line parameters
flagsFlags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
Возвращает
Returns a newly allocated common state object.

◆ SDLTest_CommonArg()

int SDLTest_CommonArg ( SDLTest_CommonState state,
int  index 
)

Process one common argument.

Аргументы
stateThe common state describing the test window to create.
indexThe index of the argument to process in argv[].
Возвращает
The number of arguments processed (i.e. 1 for –fullscreen, 2 for –video [videodriver], or -1 on error.

◆ SDLTest_CommonLogUsage()

void SDLTest_CommonLogUsage ( SDLTest_CommonState state,
const char *  argv0,
const char **  options 
)

Logs command line usage info.

This logs the appropriate command line options for the subsystems in use plus other common options, and then any application-specific options. This uses the SDL_Log() function and splits up output to be friendly to 80-character-wide terminals.

Аргументы
stateThe common state describing the test window for the app.
argv0argv[0], as passed to main/SDL_main.
optionsan array of strings for application specific options. The last element of the array should be NULL.

◆ SDLTest_CommonUsage()

const char* SDLTest_CommonUsage ( SDLTest_CommonState state)

Returns common usage information.

You should (probably) be using SDLTest_CommonLogUsage() instead, but this function remains for binary compatibility. Strings returned from this function are valid until SDLTest_CommonQuit() is called, in which case those strings' memory is freed and can no longer be used.

Аргументы
stateThe common state describing the test window to create.
Возвращает
String with usage information

◆ SDLTest_CommonInit()

SDL_bool SDLTest_CommonInit ( SDLTest_CommonState state)

Open test window.

Аргументы
stateThe common state describing the test window to create.
Возвращает
True if initialization succeeded, false otherwise

◆ SDLTest_CommonDefaultArgs()

SDL_bool SDLTest_CommonDefaultArgs ( SDLTest_CommonState state,
const int  argc,
char **  argv 
)

Easy argument handling when test app doesn't need any custom args.

Аргументы
stateThe common state describing the test window to create.
argcargc, as supplied to SDL_main
argvargv, as supplied to SDL_main
Возвращает
False if app should quit, true otherwise.

◆ SDLTest_CommonEvent()

void SDLTest_CommonEvent ( SDLTest_CommonState state,
SDL_Event event,
int *  done 
)

Common event handler for test windows.

Аргументы
stateThe common state used to create test window.
eventThe event to handle.
doneFlag indicating we are done.

◆ SDLTest_CommonQuit()

void SDLTest_CommonQuit ( SDLTest_CommonState state)

Close test window.

Аргументы
stateThe common state used to create test window.