summaryrefslogtreecommitdiff
path: root/platform/windows/context_gl_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/context_gl_win.cpp')
-rw-r--r--platform/windows/context_gl_win.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index ab66b81421..fd9e895370 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -96,6 +96,20 @@ static GLWrapperFuncPtr wrapper_get_proc_address(const char* p_function) {
}
*/
+void ContextGL_Win::set_use_vsync(bool p_use) {
+
+ if (wglSwapIntervalEXT) {
+ wglSwapIntervalEXT(p_use?1:0);
+ }
+ use_vsync=p_use;
+
+}
+
+bool ContextGL_Win::is_using_vsync() const {
+
+ return use_vsync;
+}
+
Error ContextGL_Win::initialize() {
@@ -184,7 +198,7 @@ Error ContextGL_Win::initialize() {
printf("Activated GL 3.1 context");
}
-
+ wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress ("wglSwapIntervalEXT");
// glWrapperInit(wrapper_get_proc_address);
return OK;
@@ -194,6 +208,7 @@ ContextGL_Win::ContextGL_Win(HWND hwnd,bool p_opengl_3_context) {
opengl_3_context=p_opengl_3_context;
hWnd=hwnd;
+ use_vsync=false;
}
ContextGL_Win::~ContextGL_Win() {