-
OpenGL question
My program is just a 3d object spinning around made up of quads and triangles textured with a bitmap. When its running it constantly uses 99% cpu cycles. I have seen someone post a question like this before not sure if it was this board or not but there solution was for win32. I am using opengl thru SDL. Is it normal for a simple program like this to use so much cycles? How can I fix it?
[edit] another thing, why would it constantly be running at 22fps no matter what resolution its in or how many quads/triangles are on the screen or whether its in fullscreen or not. [/edit]
-
Try adding a call to Sleep in your main message loop. This will give the cpu a chance to handle other tasks.
I'm not sure about your fps problem though. Are you sure your timing code is right? Have you tried switching release/debug and seeing the difference?
-
thanks mrwizard
the problem was the bmp i was using was high res.
-
>>When its running it constantly uses 99% cpu cycles.
Most programs that run in real time should take up 99% of the CPU...thus the reason we call them "real time"
>>another thing, why would it constantly be running at 22fps no matter what resolution its in or how many quads/triangles are on the screen or whether its in fullscreen or not.
You're calculating the frames per second wrong.
-
well i was using a program called fraps http://www.fraps.com/
maybe its not working properly but im almost certain that it is.