You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
vsync support
-works on windows -may not work on X11, if so please fix -OSX does not seem to support disabling vsync
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user