Don't call most SDL_GL_xxx functions when using WebGPU API

This commit is contained in:
Nikita Lisitsa 2025-09-16 20:45:12 +03:00
parent 7c5062e081
commit 8d25721d35

View file

@ -201,7 +201,9 @@ namespace psemek::sdl2
void window::swap()
{
#if defined(PSEMEK_GRAPHICS_API_OPENGL)
SDL_GL_SwapWindow(window_);
#endif
}
void window::show_cursor(bool show)
@ -215,8 +217,9 @@ namespace psemek::sdl2
SDL_SetRelativeMouseMode(mode ? SDL_TRUE: SDL_FALSE);
}
void window::vsync(bool on)
void window::vsync([[maybe_unused]] bool on)
{
#if defined(PSEMEK_GRAPHICS_API_OPENGL)
log::info() << "Turning VSync " << (on ? "on" : "off");
if (on)
{
@ -231,6 +234,7 @@ namespace psemek::sdl2
{
SDL_GL_SetSwapInterval(0);
}
#endif
}
void window::windowed(bool on)