Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added SDL_Quit() in FosterShutdown() #70

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Platform/src/foster_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void FosterStartup(FosterDesc desc)
FosterLogInfo("SDL: v%i.%i.%i", version.major, version.minor, version.patch);

// track SDL output
if (fstate.logLevel != FOSTER_LOGGING_NONE &&
if (fstate.logLevel != FOSTER_LOGGING_NONE &&
(fstate.logInfo || fstate.logWarn || fstate.logError))
{
SDL_LogSetOutputFunction(FosterLog_SDL, NULL);
Expand Down Expand Up @@ -119,7 +119,7 @@ void FosterStartup(FosterDesc desc)
fstate.desc.width,
fstate.desc.height,
fstate.windowCreateFlags);

if (fstate.window == NULL)
{
FosterLogError("Foster SDL_CreateWindow Failed: %s", SDL_GetError());
Expand Down Expand Up @@ -246,7 +246,7 @@ void FosterPollEvents()
value = event.jaxis.value / 32767.0f;
else
value = event.jaxis.value / 32768.0f;
fstate.desc.onControllerAxis(index, event.jaxis.axis, value);
fstate.desc.onControllerAxis(index, event.jaxis.axis, value);
}
}
// Gamepad Controller
Expand Down Expand Up @@ -327,6 +327,7 @@ void FosterShutdown()
fstate.clipboardText = NULL;
fstate.running = false;
SDL_DestroyWindow(fstate.window);
SDL_Quit();
}

FosterBool FosterIsRunning()
Expand Down Expand Up @@ -378,11 +379,11 @@ void FosterSetFlags(FosterFlags flags)
if (flags != fstate.flags)
{
// fullscreen
SDL_SetWindowFullscreen(fstate.window,
SDL_SetWindowFullscreen(fstate.window,
FOSTER_CHECK(flags, FOSTER_FLAG_FULLSCREEN) ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);

// resizable
SDL_SetWindowResizable(fstate.window,
SDL_SetWindowResizable(fstate.window,
FOSTER_CHECK(flags, FOSTER_FLAG_RESIZABLE) ? SDL_TRUE : SDL_FALSE);

// mouse visible
Expand Down Expand Up @@ -670,7 +671,7 @@ void FosterLogInfo(const char* fmt, ...)
if (fstate.logLevel == FOSTER_LOGGING_NONE ||
fstate.logInfo == NULL)
return;

char msg[FOSTER_MAX_MESSAGE_SIZE];
va_list ap;
va_start(ap, fmt);
Expand Down
Loading