mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-19 14:01:01 +00:00
x11: Deal with difference in GLX_EXT_swap_control_tear behavior.
Mesa and Nvidia handle it differently, and one or the other may fix their
implementation in the future, so test which way it works at runtime.
Reference Issue #8004.
(cherry picked from commit 74a2542564)
This commit is contained in:
@@ -205,6 +205,11 @@ Render()
|
||||
ctx.glRotatef(5.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
static void LogSwapInterval(void)
|
||||
{
|
||||
SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval());
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int fsaa, accel;
|
||||
@@ -300,7 +305,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
SDL_GetCurrentDisplayMode(0, &mode);
|
||||
SDL_Log("Screen BPP : %" SDL_PRIu32 "\n", SDL_BITSPERPIXEL(mode.format));
|
||||
SDL_Log("Swap Interval : %d\n", SDL_GL_GetSwapInterval());
|
||||
|
||||
LogSwapInterval();
|
||||
|
||||
SDL_GetWindowSize(state->windows[0], &dw, &dh);
|
||||
SDL_Log("Window Size : %d,%d\n", dw, dh);
|
||||
SDL_GL_GetDrawableSize(state->windows[0], &dw, &dh);
|
||||
@@ -408,6 +415,7 @@ int main(int argc, char *argv[])
|
||||
SDL_GL_MakeCurrent(state->windows[i], context);
|
||||
if (update_swap_interval) {
|
||||
SDL_GL_SetSwapInterval(swap_interval);
|
||||
LogSwapInterval();
|
||||
}
|
||||
SDL_GL_GetDrawableSize(state->windows[i], &w, &h);
|
||||
ctx.glViewport(0, 0, w, h);
|
||||
|
||||
Reference in New Issue
Block a user