mirror of
https://github.com/NoelFB/blah.git
synced 2025-12-14 13:17:07 +08:00
added App::focused and System::open_url apis
This commit is contained in:
@ -494,6 +494,12 @@ void Platform::set_position(int x, int y)
|
||||
SDL_SetWindowPosition(g_platform.window, x, y);
|
||||
}
|
||||
|
||||
bool Platform::get_focused()
|
||||
{
|
||||
auto flags = SDL_GetWindowFlags(g_platform.window);
|
||||
return (flags & SDL_WINDOW_INPUT_FOCUS) != 0 && (flags & SDL_WINDOW_MINIMIZED) == 0;
|
||||
}
|
||||
|
||||
void Platform::set_fullscreen(bool enabled)
|
||||
{
|
||||
if (enabled)
|
||||
@ -768,4 +774,9 @@ void* Platform::d3d11_get_hwnd()
|
||||
#endif
|
||||
}
|
||||
|
||||
void Platform::open_url(const char* url)
|
||||
{
|
||||
SDL_OpenURL(url);
|
||||
}
|
||||
|
||||
#endif // BLAH_PLATFORM_SDL2
|
||||
|
||||
Reference in New Issue
Block a user