Advertisement

NeHe Lesson 2 & Low FPS

Started by August 17, 2000 05:11 PM
1 comment, last by fs4344afa 24 years, 3 months ago
Ok, I''ve posted this in the opengl/directx forum but with my recent test it makes more sense to be here. I run NeHe''s lesson2 and only get 53 FPS in both vid modes. Here is how I calulated my FPS. Add the library winmm.lib Add these lines to the top of the program after the glaux.h #include char fps[50]; unsigned int time_start; unsigned int time_finish; unsigned int frames = 0; Modify the winamin as follows: time_start = timeGetTime(); while(!done) { frames++; SwapBuffers(hDC); } time_finish = timeGetTime(); sprintf(fps, "FPS: %f", (float)frames/((time_finish-time_start)/1000.0f)); MessageBox(NULL, fps, "App Name", MB_OK); // Shutdown KillGLWindow(); So tell me, what is the deal here? Why are the fps so low in such a simple program? Feel free to e-mail me if you wish magnus_dx@hotmail.com. This really confuses me. When I change the first line of DrawGLScene to return true; i can get over 300 fps. If I add the return true after the glClear, I get approx 80. Whats going on here. Please enlighten me. Thank you. - Keith (Still stumped but willing to experiment and learn!)
I think you have VSYNC on so that you can''t get more than ~60 without turning it off.
Advertisement
ugg.. Using NeHe''s tutorial #2, If I return true; in the VERY first line of DrawGlScene() Bypassing the glclear, I am swapping buffers at 254 FPS, but when I an calling the full DrawGLScene I get 53 FPS, so I don''t think that is the problem.??

NeHe Lesson 2 base FPS: 53
return true; first line of DrawGLSCene FPS: 254
comment glClear FPS: 140
comment glLoadIdentity FPS: 84
comment both (still calling rest of DrawGLScene) FPS: 250

So whats the deal? somebody MUST know something????

- Keith

This topic is closed to new replies.

Advertisement