window: fix vsync flags
parent
10746e8b0f
commit
6f9fb45364
|
@ -2008,9 +2008,9 @@ enum WINDOW_FLAGS {
|
|||
WINDOW_FIXED = 0x200,
|
||||
WINDOW_TRANSPARENT = 0x400,
|
||||
WINDOW_BORDERLESS = 0x800,
|
||||
WINDOW_VSYNC = 0,
|
||||
WINDOW_VSYNC_DISABLED = 0,
|
||||
WINDOW_VSYNC_ADAPTIVE = 0x1000,
|
||||
WINDOW_VSYNC_DISABLED = 0x2000,
|
||||
WINDOW_VSYNC = 0x2000,
|
||||
};
|
||||
bool window_create(float scale, unsigned flags);
|
||||
bool window_create_from_handle(void *handle, float scale, unsigned flags);
|
||||
|
|
|
@ -18655,9 +18655,9 @@ enum WINDOW_FLAGS {
|
|||
WINDOW_TRANSPARENT = 0x400,
|
||||
WINDOW_BORDERLESS = 0x800,
|
||||
|
||||
WINDOW_VSYNC = 0,
|
||||
WINDOW_VSYNC_DISABLED = 0,
|
||||
WINDOW_VSYNC_ADAPTIVE = 0x1000,
|
||||
WINDOW_VSYNC_DISABLED = 0x2000,
|
||||
WINDOW_VSYNC = 0x2000,
|
||||
};
|
||||
|
||||
API bool window_create(float scale, unsigned flags);
|
||||
|
@ -379457,7 +379457,7 @@ bool window_create_from_handle(void *handle, float scale, unsigned flags) {
|
|||
flags |= optioni("--vsync-adaptive", 0) || flag("--vsync-adaptive") ? WINDOW_VSYNC_ADAPTIVE : 0;
|
||||
int has_adaptive_vsync = glfwExtensionSupported("WGL_EXT_swap_control_tear") || glfwExtensionSupported("GLX_EXT_swap_control_tear") || glfwExtensionSupported("EXT_swap_control_tear");
|
||||
int wants_adaptive_vsync = (flags & WINDOW_VSYNC_ADAPTIVE);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (flags & WINDOW_VSYNC_DISABLED ? 0 : 1);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (!(flags & WINDOW_VSYNC) ? 0 : 1);
|
||||
glfwSwapInterval(interval);
|
||||
|
||||
const GLFWvidmode *mode = glfwGetVideoMode(monitor ? monitor : glfwGetPrimaryMonitor());
|
||||
|
|
|
@ -378,7 +378,7 @@ bool window_create_from_handle(void *handle, float scale, unsigned flags) {
|
|||
flags |= optioni("--vsync-adaptive", 0) || flag("--vsync-adaptive") ? WINDOW_VSYNC_ADAPTIVE : 0;
|
||||
int has_adaptive_vsync = glfwExtensionSupported("WGL_EXT_swap_control_tear") || glfwExtensionSupported("GLX_EXT_swap_control_tear") || glfwExtensionSupported("EXT_swap_control_tear");
|
||||
int wants_adaptive_vsync = (flags & WINDOW_VSYNC_ADAPTIVE);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (flags & WINDOW_VSYNC_DISABLED ? 0 : 1);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (!(flags & WINDOW_VSYNC) ? 0 : 1);
|
||||
glfwSwapInterval(interval);
|
||||
|
||||
const GLFWvidmode *mode = glfwGetVideoMode(monitor ? monitor : glfwGetPrimaryMonitor());
|
||||
|
|
|
@ -19,9 +19,9 @@ enum WINDOW_FLAGS {
|
|||
WINDOW_TRANSPARENT = 0x400,
|
||||
WINDOW_BORDERLESS = 0x800,
|
||||
|
||||
WINDOW_VSYNC = 0,
|
||||
WINDOW_VSYNC_DISABLED = 0,
|
||||
WINDOW_VSYNC_ADAPTIVE = 0x1000,
|
||||
WINDOW_VSYNC_DISABLED = 0x2000,
|
||||
WINDOW_VSYNC = 0x2000,
|
||||
};
|
||||
|
||||
API bool window_create(float scale, unsigned flags);
|
||||
|
|
|
@ -26601,7 +26601,7 @@ bool window_create_from_handle(void *handle, float scale, unsigned flags) {
|
|||
flags |= optioni("--vsync-adaptive", 0) || flag("--vsync-adaptive") ? WINDOW_VSYNC_ADAPTIVE : 0;
|
||||
int has_adaptive_vsync = glfwExtensionSupported("WGL_EXT_swap_control_tear") || glfwExtensionSupported("GLX_EXT_swap_control_tear") || glfwExtensionSupported("EXT_swap_control_tear");
|
||||
int wants_adaptive_vsync = (flags & WINDOW_VSYNC_ADAPTIVE);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (flags & WINDOW_VSYNC_DISABLED ? 0 : 1);
|
||||
int interval = has_adaptive_vsync && wants_adaptive_vsync ? -1 : (!(flags & WINDOW_VSYNC) ? 0 : 1);
|
||||
glfwSwapInterval(interval);
|
||||
|
||||
const GLFWvidmode *mode = glfwGetVideoMode(monitor ? monitor : glfwGetPrimaryMonitor());
|
||||
|
|
|
@ -4722,9 +4722,9 @@ enum WINDOW_FLAGS {
|
|||
WINDOW_TRANSPARENT = 0x400,
|
||||
WINDOW_BORDERLESS = 0x800,
|
||||
|
||||
WINDOW_VSYNC = 0,
|
||||
WINDOW_VSYNC_DISABLED = 0,
|
||||
WINDOW_VSYNC_ADAPTIVE = 0x1000,
|
||||
WINDOW_VSYNC_DISABLED = 0x2000,
|
||||
WINDOW_VSYNC = 0x2000,
|
||||
};
|
||||
|
||||
API bool window_create(float scale, unsigned flags);
|
||||
|
|
Loading…
Reference in New Issue