testprograms: parse arguments using SDLTest_CommonState

This commit is contained in:
Anonymous Maarten authored and Anonymous Maarten committed 2023-03-17 17:54:16 +01:00
1 parent 8bea41f737
commit 4a6528e3f0
71 files changed
+1516 -389

No files matched your search

+15 -1
View File
@@ -23,7 +23,7 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test_font.h>
#include <SDL3/SDL_test.h>
static SDL_Window *window;
static SDL_Renderer *renderer;
@@ -249,9 +249,22 @@ static void loop(void)
int main(int argc, char *argv[])
{
SDLTest_CommonState *state;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (state == NULL) {
return 1;
}
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
/* Disable mouse emulation */
SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");
@@ -304,5 +317,6 @@ int main(int argc, char *argv[])
#endif
SDL_Quit();
SDLTest_CommonDestroyState(state);
return 0;
}