Opengl Speed Problems

Started by
9 comments, last by MrFRag 19 years, 2 months ago
Hi everyone, I'm developing a game, but I'm having some strange problems: the code I've developed works good on my pc (about 250 - 300 fps) but if I give it to my friends it works at about 70fps, even on pc with a video card faster than mine! How can it be possible? I'm using an ati radeon 8500 with 64mb of ram, and the game is compiled with Dev C++, for rendering I'm using opengl and it's extensions. I thought it was a problem due to vsync, but nothing change with it enabled or disabled.
Advertisement
maybe they have older drivers?
[size="1"]
Quote:Original post by mrbastard
maybe they have older drivers?


I don't think, but they have no problems running other games...
That definately stinks of vsync problems. I would say: don't care, unless drawing more things make it drop even lower than 70fps.
V synch?
v-sync is the process of showing the backbuffer in unison with the refresh rate of the display device. Your friend can probably control v-sync options somewhere in his graphic card settings.
moe.ron
If you check your friend's monitor setting you probably will see his monitor refresh rate set to 70mhz. VSync is used by the monitor to tell the video card when to draw the next frame because the current sync is done. Disabling vsync simply tells the video card to keep sending data to the monitor as fast as possible hence why 200fps is achievable.
I've tryed to enable vsync on my pc using wglSwapInterval(1); and i'm running at about 70fps too now, but the movements seems "laggy", specially when i rotate the view around me. I've read some articles talking aboput triple buffering to solve this problem, do you think it's a good solution or is there something better?
I'm foreseeing that the "laggy" rotation is caused because the rotation interpolation isn't calculated based upon time passed. Now that you've enabled v sync and limited yourself to 70 fps, your code that is responsible for the rotation is now only executing at 70 fps (instead of the previous 250-300fps) which will obviously feel a lot slower/laggy.
correct me if i'm wrong, you mean my code is something like this right?

...
while (!exit) {
...
rotate_camera()
render()
swapbuffers()
}
...

so i update the camera at every frame.

Instead of a code of this type, i'm using directinput to get the inputs from keyboard and mouse, but i update the camera position and rotations (using a quaternion based class) at regular intervals using two timers (one for mouse and the other one for keyboard), so, my code is something like this:

...
timers initialisation()
while (!exit) {
mouse.getStatus() //i read the status stored in the class
render()
swapbuffers()
}
...

Windowprocedure() {
if (message = WM_TIMER)
if (timerId = mouse) {
//using directinput, i update the status of the mouse object
mouse.updateStatus()
}
}

This topic is closed to new replies.

Advertisement