Is it possible? Since ive noticed that v-sync does not work at all on my laptop, so I create the FPS limiter βmanuallyβ, and now I would like to use the FPS restriction that the user set on his screen.
Edit: I mean the speed of the hz monitor.
Edit3: heres the code I was working in (think ... is something wrong?):
DEVMODE lpDevMode; memset(&lpDevMode, 0, sizeof(DEVMODE)); lpDevMode.dmSize = sizeof(DEVMODE); lpDevMode.dmDriverExtra = 0; if(EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &lpDevMode) == 0){ framerate_limit = 60;
Upon request, here is my v-sync activation code jay.lee asked:
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL; // global ... wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT"); v_sync_enabled = 0; if(wglSwapIntervalEXT != NULL){ if(wglSwapIntervalEXT(1) != FALSE){ v_sync_enabled = 1; } }
source share