mirror of
https://github.com/encounter/SDL.git
synced 2025-12-20 02:15:27 +00:00
test: added SDLTest_CommonDefaultArgs()
This is for test apps that don't need custom command line arguments; it lets us reduce the boilerplate code a tiny bit.
This commit is contained in:
@@ -174,18 +174,10 @@ main(int argc, char *argv[])
|
||||
if (!state) {
|
||||
return 1;
|
||||
}
|
||||
for (i = 1; i < argc;) {
|
||||
int consumed;
|
||||
|
||||
consumed = SDLTest_CommonArg(state, i);
|
||||
if (consumed == 0) {
|
||||
SDL_Log("Usage: %s %s\n", argv[0], SDLTest_CommonUsage(state));
|
||||
return 1;
|
||||
}
|
||||
i += consumed;
|
||||
}
|
||||
if (!SDLTest_CommonInit(state)) {
|
||||
quit(2);
|
||||
if (!SDLTest_CommonDefaultArgs(state, argc, argv) || !SDLTest_CommonInit(state)) {
|
||||
SDLTest_CommonQuit(state);
|
||||
return 1;
|
||||
}
|
||||
|
||||
drawstates = SDL_stack_alloc(DrawState, state->num_windows);
|
||||
|
||||
Reference in New Issue
Block a user