For some reason, and despite having vsync set to on, my frame rate doesn't lock to my monitor's refresh rate. I'm using GZDoom r1547 (it's a little old - I know). My current screen/monitor resolution is 1152x864 (in-game resolution is 800x600), and running in windowed mode (I also tried it in fullscreen mode, but there was no difference).
With ZDoom, vsync works fine - I get a steady 70-ish fps at the start point of E1M1 of Doom, and no more. But with GZDoom, the frame rate goes beyond that, up to 130, even though I have that option set to on.
I tried vid_maxfps with setting the max to 70, however it didn't have any effect either; the frame rate is still way up. On the other hand, cl_capfps still works.
OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen) :
Super(hMonitor, width, height, bits, refreshHz, fullscreen)
{
GLRenderer = new FGLRenderer(this);
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
UpdatePalette ();
ScreenshotBuffer = NULL;
LastCamera = NULL;
InitializeState();
gl_SetupMenu();
gl_GenerateGlobalBrightmapFromColormap();
DoSetGamma();
needsetgamma = true;
swapped = false;
Accel2D = true;
if (gl.SetVSync!=NULL) gl.SetVSync(vid_vsync);
}
This is the only place in the GL code where vid_vsync is referenced. To me, it means that your OpenGL drivers either do not support SetVSync at all (function not present) or they do but it doesn't work.
Gez wrote:vid_maxfps isn't implemented in the OpenGL renderer.
Oh! I wasn't aware of that. Why is it not, I wonder? Any specific reason(s)?
I have no idea how to do that, I have not much motivation to look into it, and if you go back to the original feature request thread, Graf was hostile to the idea.
Blue Shadow wrote:
To me, it means that your OpenGL drivers either do not support SetVSync at all (function not present) or they do but it doesn't work.
Not that it matters, now, but is there a way for me to find out if it's supported or not?
Well. If you can compile a custom build, you could look for this code in src/gl/system/gl_interface.cpp: