mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 23:22:48 +02:00
unix: Factor out the check for GTK into an internal function
This will allow the same check to be done by the libdecor integration. Helps: https://github.com/libsdl-org/sdl2-compat/issues/564 Signed-off-by: Simon McVittie <smcv@debian.org>
This commit is contained in:
committed by
Sam Lantinga
parent
76352f2931
commit
9e0b31b297
@@ -81,12 +81,21 @@ static bool IsGtkInit()
|
||||
return libgdk != NULL && libgtk != NULL;
|
||||
}
|
||||
|
||||
static bool InitGtk(void)
|
||||
bool SDL_CanUseGtk(void)
|
||||
{
|
||||
if (!SDL_GetHintBoolean("SDL_ENABLE_GTK", true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool InitGtk(void)
|
||||
{
|
||||
if (!SDL_CanUseGtk()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsGtkInit()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ typedef struct SDL_GtkContext
|
||||
} gtk;
|
||||
} SDL_GtkContext;
|
||||
|
||||
extern bool SDL_CanUseGtk(void);
|
||||
extern bool SDL_Gtk_Init(void);
|
||||
extern void SDL_Gtk_Quit(void);
|
||||
extern SDL_GtkContext *SDL_Gtk_EnterContext(void);
|
||||
|
||||
Reference in New Issue
Block a user