mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-12 08:04:09 +02:00
SDL2: proper fix for the vsync setting. (#326)
This commit is contained in:
committed by
GitHub
parent
aea6af174a
commit
8e10e1cfac
@@ -1597,6 +1597,8 @@ namespace GAPI {
|
|||||||
if (wglSwapIntervalEXT) wglSwapIntervalEXT(enable ? 1 : 0);
|
if (wglSwapIntervalEXT) wglSwapIntervalEXT(enable ? 1 : 0);
|
||||||
#elif _OS_LINUX
|
#elif _OS_LINUX
|
||||||
if (glXSwapIntervalSGI) glXSwapIntervalSGI(enable ? 1 : 0);
|
if (glXSwapIntervalSGI) glXSwapIntervalSGI(enable ? 1 : 0);
|
||||||
|
#elif defined(__SDL2__)
|
||||||
|
SDL_GL_SetSwapInterval(enable ? 1 : 0);
|
||||||
#elif defined(_OS_RPI) || defined(_OS_CLOVER) || defined(_OS_SWITCH)
|
#elif defined(_OS_RPI) || defined(_OS_CLOVER) || defined(_OS_SWITCH)
|
||||||
eglSwapInterval(display, enable ? 1 : 0);
|
eglSwapInterval(display, enable ? 1 : 0);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -88,7 +88,6 @@ int sdl_numjoysticks, sdl_numcontrollers;
|
|||||||
SDL_Joystick *sdl_joysticks[MAX_JOYS];
|
SDL_Joystick *sdl_joysticks[MAX_JOYS];
|
||||||
SDL_GameController *sdl_controllers[MAX_JOYS];
|
SDL_GameController *sdl_controllers[MAX_JOYS];
|
||||||
SDL_Window *sdl_window;
|
SDL_Window *sdl_window;
|
||||||
SDL_Renderer *sdl_renderer;
|
|
||||||
SDL_DisplayMode sdl_displaymode;
|
SDL_DisplayMode sdl_displaymode;
|
||||||
|
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
@@ -493,10 +492,6 @@ int main(int argc, char **argv) {
|
|||||||
Core::height = h;
|
Core::height = h;
|
||||||
|
|
||||||
SDL_GLContext context = SDL_GL_CreateContext(sdl_window);
|
SDL_GLContext context = SDL_GL_CreateContext(sdl_window);
|
||||||
SDL_GL_SetSwapInterval(1);
|
|
||||||
|
|
||||||
sdl_renderer = SDL_CreateRenderer(sdl_window, -1,
|
|
||||||
SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
|
|
||||||
|
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
|
|
||||||
@@ -538,7 +533,6 @@ int main(int argc, char **argv) {
|
|||||||
sndFree();
|
sndFree();
|
||||||
Game::deinit();
|
Game::deinit();
|
||||||
|
|
||||||
SDL_DestroyRenderer(sdl_renderer);
|
|
||||||
SDL_DestroyWindow(sdl_window);
|
SDL_DestroyWindow(sdl_window);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user