X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Fbuilddeps%2Fwin32%2Fsdl%2Finclude%2FSDL2%2FSDL_test_common.h;h=c34d0d103071e537836c95b0e0635139b22270ac;hp=0ebf31cb674171931adf0e7c0cdef85c6ef4cc6f;hb=1e434bee7af23e6dfd2130a8eadd131e5da3d643;hpb=c40448285437999d5a83a3c9adb62c58ba8640bc diff --git a/misc/builddeps/win32/sdl/include/SDL2/SDL_test_common.h b/misc/builddeps/win32/sdl/include/SDL2/SDL_test_common.h index 0ebf31cb..c34d0d10 100644 --- a/misc/builddeps/win32/sdl/include/SDL2/SDL_test_common.h +++ b/misc/builddeps/win32/sdl/include/SDL2/SDL_test_common.h @@ -1,6 +1,6 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2016 Sam Lantinga + Copyright (C) 1997-2019 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -29,8 +29,8 @@ /* Ported from original test\common.h file. */ -#ifndef _SDL_test_common_h -#define _SDL_test_common_h +#ifndef SDL_test_common_h_ +#define SDL_test_common_h_ #include "SDL.h" @@ -140,14 +140,20 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); */ int SDLTest_CommonArg(SDLTest_CommonState * state, int index); + /** - * \brief Returns common usage information + * \brief Logs command line usage info. * - * \param state The common state describing the test window to create. + * 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. * - * \returns String with usage information + * \param state The common state describing the test window for the app. + * \param argv0 argv[0], as passed to main/SDL_main. + * \param options an array of strings for application specific options. The last element of the array should be NULL. */ -const char *SDLTest_CommonUsage(SDLTest_CommonState * state); +void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options); /** * \brief Open test window. @@ -158,6 +164,17 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state); */ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); +/** + * \brief Easy argument handling when test app doesn't need any custom args. + * + * \param state The common state describing the test window to create. + * \param argc argc, as supplied to SDL_main + * \param argv argv, as supplied to SDL_main + * + * \returns False if app should quit, true otherwise. + */ +SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv); + /** * \brief Common event handler for test windows. * @@ -183,6 +200,6 @@ void SDLTest_CommonQuit(SDLTest_CommonState * state); #endif #include "close_code.h" -#endif /* _SDL_test_common_h */ +#endif /* SDL_test_common_h_ */ /* vi: set ts=4 sw=4 expandtab: */