Jump to content
  • Advertisement
Sign in to follow this  
The_Nerd

OpenGL Very funny FPS drop

This topic is 5399 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just finished porting my Linux OpenGL app to Windows. Everything works fine except one thing... In Linux I get around 600fps at 1024x768x32, however, on Windows at the same resolution, I get 60fps. There is one other noteable thing, on Linux, the fps swings pretty greatly the more pollygons I put on the screen, but in Windows it doesn't fluctuate as much. It almost seams as if there is a timer in Windows or something... What am I missing? Following are my specs: AMD XP 1.8gz processor Nvidia geForce 4 TI 256 MB ddr SDL for Window init and lowlevel stuff OpenGL 1.5 (or what ever the newest version is) Windows: 60fps, relitively steady, doesn't change too much with pollygon count Linux: 600fps, changes dramtically with pollygon count

Share this post


Link to post
Share on other sites
Advertisement
Most likely you have vertical sync enabled in Windows. 60 Hz is a common refresh rate. You may be able to set this to off by default in the driver settings. There's also a WGL extension to change this.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I noticed the same problem with openGL under windows. for some reason DirectX apps are usually faster in windows. It is suprising to hear that OpenGL works that fast inder linux. There must be a setting on the initialization of the window that can fix the bug. Are you using your own win32 initialization code or are you using GLUT?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I noticed the same problem with openGL under windows. for some reason DirectX apps are usually faster in windows. It is suprising to hear that OpenGL works that fast inder linux. There must be a setting on the initialization of the window that can fix the bug. Are you using your own win32 initialization code or are you using GLUT?


You've probably got vsync off for DirectX in your drivers. Or your drivers just turn it off for DirectX by default.

Share this post


Link to post
Share on other sites
I am using SDL, not GLUT. I am also not using ANY DirectX code what so ever? Pretty cool eh'?

Thanks guys. I'll look into vsync. Always wondered what vsync did. :p

Share this post


Link to post
Share on other sites
I also had fun with this kind of behavior, at home i'm stuck at 60 fps (so i was pretty sad about my programming talents) but when i tried the exact same program on my computer at work i got 2800 fps :)
Now i do only care about falling under 60 fps on the lower-end machine.

Share this post


Link to post
Share on other sites
Quote:
Original post by The_Nerd
I am using SDL, not GLUT. I am also not using ANY DirectX code what so ever? Pretty cool eh'?


Actually, SDL is built on top of DirectX :)

If you want to turn frame sync off under Windows check out WGL_EXT_swap_control. Or you can just use the following:


void setFrameSync(bool enabled)
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT =
(PFNWGLSWAPINTERVALEXTPROC)SDL_GL_GetProcAddress("wglSwapIntervalEXT");
if (wglSwapIntervalEXT)
wglSwapIntervalEXT(enabled ? 1 : 0);
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!