Go to the source code of this file.
|
SDLTest_CommonState * | SDLTest_CommonCreateState (char **argv, SDL_InitFlags flags) |
|
void | SDLTest_CommonDestroyState (SDLTest_CommonState *state) |
|
int | SDLTest_CommonArg (SDLTest_CommonState *state, int index) |
|
void | SDLTest_CommonLogUsage (SDLTest_CommonState *state, const char *argv0, const char **options) |
|
bool | SDLTest_CommonInit (SDLTest_CommonState *state) |
|
bool | SDLTest_CommonDefaultArgs (SDLTest_CommonState *state, int argc, char **argv) |
|
void | SDLTest_PrintEvent (const SDL_Event *event) |
|
void | SDLTest_CommonEvent (SDLTest_CommonState *state, SDL_Event *event, int *done) |
|
SDL_AppResult | SDLTest_CommonEventMainCallbacks (SDLTest_CommonState *state, const SDL_Event *event) |
|
void | SDLTest_CommonQuit (SDLTest_CommonState *state) |
|
void | SDLTest_CommonDrawWindowInfo (SDL_Renderer *renderer, SDL_Window *window, float *usedHeight) |
|
◆ DEFAULT_WINDOW_HEIGHT
#define DEFAULT_WINDOW_HEIGHT 480 |
◆ DEFAULT_WINDOW_WIDTH
#define DEFAULT_WINDOW_WIDTH 640 |
Common functions of SDL test framework.
This code is a part of the SDL test library, not the main SDL library.
Definition at line 42 of file SDL_test_common.h.
◆ VERBOSE_AUDIO
#define VERBOSE_AUDIO 0x00000010 |
◆ VERBOSE_EVENT
#define VERBOSE_EVENT 0x00000008 |
◆ VERBOSE_MODES
#define VERBOSE_MODES 0x00000002 |
◆ VERBOSE_MOTION
#define VERBOSE_MOTION 0x00000020 |
◆ VERBOSE_RENDER
#define VERBOSE_RENDER 0x00000004 |
◆ VERBOSE_VIDEO
#define VERBOSE_VIDEO 0x00000001 |
◆ SDLTest_FinalizeArgumentParserFp
typedef void(* SDLTest_FinalizeArgumentParserFp) (void *arg) |
◆ SDLTest_ParseArgumentsFp
typedef int(* SDLTest_ParseArgumentsFp) (void *data, char **argv, int index) |
◆ SDLTest_VerboseFlags
◆ SDLTest_CommonArg()
Process one common argument.
- Parameters
-
state | The common state describing the test window to create. |
index | The 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_CommonCreateState()
Parse command line parameters and create common state.
- Parameters
-
argv | Array of command line parameters |
flags | Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) |
- Returns
- a newly allocated common state object.
◆ SDLTest_CommonDefaultArgs()
Easy argument handling when test app doesn't need any custom args.
- Parameters
-
state | The common state describing the test window to create. |
argc | argc, as supplied to SDL_main |
argv | argv, as supplied to SDL_main |
- Returns
- false if app should quit, true otherwise.
◆ SDLTest_CommonDestroyState()
Free the common state object.
You should call SDL_Quit() before calling this function.
- Parameters
-
state | The common state object to destroy |
◆ SDLTest_CommonDrawWindowInfo()
Draws various window information (position, size, etc.) to the renderer.
- Parameters
-
renderer | The renderer to draw to. |
window | The window whose information should be displayed. |
usedHeight | Returns the height used, so the caller can draw more below. |
◆ SDLTest_CommonEvent()
Common event handler for test windows if you use a standard SDL_main.
- Parameters
-
state | The common state used to create test window. |
event | The event to handle. |
done | Flag indicating we are done. |
◆ SDLTest_CommonEventMainCallbacks()
Common event handler for test windows if you use SDL_AppEvent.
This does not free anything in event
.
- Parameters
-
state | The common state used to create test window. |
event | The event to handle. |
- Returns
- Value suitable for returning from SDL_AppEvent().
◆ SDLTest_CommonInit()
Open test window.
- Parameters
-
state | The common state describing the test window to create. |
- Returns
- true if initialization succeeded, false otherwise
◆ 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.
- Parameters
-
state | The common state describing the test window for the app. |
argv0 | argv[0], as passed to main/SDL_main. |
options | an array of strings for application specific options. The last element of the array should be NULL. |
◆ SDLTest_CommonQuit()
Close test window.
- Parameters
-
state | The common state used to create test window. |
◆ SDLTest_PrintEvent()
void SDLTest_PrintEvent |
( |
const SDL_Event * |
event | ) |
|
Print the details of an event.
This is automatically called by SDLTest_CommonEvent() as needed.
- Parameters
-