That’s a measurement artefact. Most OpenGL functions simply append a command to the queue and return immediately. A buffer swap performs an implicit glFlush, which sends any queued commands to the GPU. If the application is GPU-limited (which is usually the case), eventually the GPU-side buffer will fill up and the client will have to wait until there’s enough space in the GPU-side buffer to send the commands.
So if you’re performing timing on the CPU, the buffer swap will end up taking most of the time because that’s where the client waits for the GPU to actually execute the commands it’s been sending.
Possibly, but it depends entirely upon the code. The code might be inefficient, or maybe it’s just asking too much of the GPU.
You can use GPU-side timing (glBeginQuery/glEndQuery with GL_TIME_ELAPSED and glQueryCounter with GL_TIMESTAMP) to measure how long specific commands (or groups of commands) take to execute.
That’s a very old system with all discontinued components.
It’s not clear from your post if you have a Pentium 4 or a Core i3 4th Gen, but both are old, with the Pentium 4 being particularly old.
A 32-bit desktop OS is very unusual these days.
The GeForce FX 5200 is definitely your weakest link. That’s almost 20 years old, it was a very weak GPU even when new, hasn’t gotten better with age, and while it claimed OpenGL 2.0 support, some OpenGL 2.0 features would punt it back to software emulation.
The overwhelming probability is that your code is slow because your system is slow. You’re running outdated, weak components that are no longer supported by their manufacturers.
Your choices amount to either simplifying your code, buying a new system, or (if you’re unable or unwilling to do either) accepting that you’ll get low performance.
What GClements and mhagain said. In addition, disable VSync and retime your frames (29 fps is suspiciously close to 2 60Hz VBlank intervals).
You’ve provided almost no info on what you are actually doing, nor have you really defined the problem.
Stop drawing everything, just call SwapBuffers() + glClear() + glFinish() each frame, and time+optimize that. Then gradually add in content, retiming at each stage. That’ll show you where your time is going. Profile to determine whether you’re just submitting it very inefficienly (CPU bound) or hitting the limits of your GPU’s rendering performance (GPU bound). However, you need to seriously evaluate the cost/benefit of: 1) just upgrading your system and 2) spending precious dev time on such old hardware with (in many cases) limited future benefit on modern hardware.