diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-07-30 02:31:32 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-07-30 02:31:32 +0400 |
commit | 29f8dfd37a2fbf4190e551bef0b04ff1ae1fd7b6 (patch) | |
tree | af50623534adee419cecbbf6e0d8dd789409d266 /intern/ghost/intern/GHOST_WindowWin32.cpp | |
parent | 2840edba840382f0957c4963c3613c7836ac5979 (diff) |
BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost.
Diffstat (limited to 'intern/ghost/intern/GHOST_WindowWin32.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index b0d0b1a5b5d..c264686fbb1 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -648,6 +648,20 @@ GHOST_TSuccess GHOST_WindowWin32::swapBuffers() return ::SwapBuffers(hDC) == TRUE ? GHOST_kSuccess : GHOST_kFailure; } +GHOST_TSuccess GHOST_WindowWin32::setSwapInterval(int interval) +{ + if (!WGL_EXT_swap_control) + return GHOST_kFailure; + return wglSwapIntervalEXT(interval) == TRUE ? GHOST_kSuccess : GHOST_kFailure; +} + +int GHOST_WindowWin32::getSwapInterval() +{ + if (WGL_EXT_swap_control) + return wglGetSwapIntervalEXT(); + + return 0; +} GHOST_TSuccess GHOST_WindowWin32::activateDrawingContext() { |