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

+14
View File
@@ -12,11 +12,24 @@
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>
#include <SDL3/SDL_test.h>
int main(int argc, char **argv)
{
SDL_DisplayID *displays;
int i;
SDLTest_CommonState *state;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, 0);
if (state == NULL) {
return 1;
}
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
}
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError());
@@ -38,5 +51,6 @@ int main(int argc, char **argv)
}
SDL_Quit();
SDLTest_CommonDestroyState(state);
return 0;
}