OpenGL much slower in Windows than in Linux


I’m making a game using SDL and OpenGL in C++. I mainly develop it in Linux. The FPS is ok in Linux. When profiling, the physics turn out to be slower than the graphics, which makes sense since I don’t draw that much. So no OpenGL problems there.

However I compiled the exact same program under Windows from the Dev-C++ IDE, and it only ran at 11 fps (even with optimizations).

Dev-C++ also has this profiling tool, but if I use it, it gives the same result as under Linux, even though in Windows the framerate is 6 times lower!

It seems related to the drawing though, because if I draw less stuff the FPS goes up.

There’s also a random factor: Sometimes if I start up the game and close 1 window (an internal window in the game also drawn by OpenGL), then suddenly the framerate goes up to 60FPS (the maximum). But other times it doesn’t. So there’s something random going on.

So the framerate isn’t dependent on the number of triangles and appearantly sometimes is 11, other times if there’s a marginal amount less it suddenly jumps to 60.

Is there something about OpenGL in Windows that is different than in Linux, that could be creating a bottleneck in Windows that I don’t notice in Linux? Or are the NVidia drivers in Windows problematic for OpenGL? It’s a GeForce 7600 card by the way.

Try disabling vsync for the 60Hz limitation, which would also affect the performance of the two windows case.

Always check the glGetString(GL_RENDERER) in case of inexplicable slowdowns. If you selected the wrong OpenGL implementation under Windows (Microsoft’s GDI Generic OpenGL version 1.1), the rendering would happen on the CPU.

Next try separating your physics, graphics, etc subsystems for benching to be sure you’re measuring the right thing and not comparing apples to oranges (which you ought to be doing anyways).

Profile each system separately to know exactly where your time is being spent… leave nothing to chance or guesswork (that’s what my grandma always said).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.