Good afternoon, Charles,
Does XP default to 60 fps VSYNC?
All Windows platforms default to 60FPS/1. I don't know the real idea behind 30FPS/2 on a PC; perhaps it was originally meant for laptops with on-board video chips. Now that higher-end modern notebooks may, and actually do, have discrete miniature video cards, they also default to 60FPS but 30FPS still holds true for lower-end business-style notebooks with on-board chips.
VSYNC=1 and VSYNC=2 are actually deprecated settings. The bad effect of
fixed-rate VSYNC'ing is that once the scene becomes so heavily populated with static scenery and moving objects that the current OpenGL rendering technique (immediate mode, display lists, vertex buffer objects, or vertex shaders plus the associated fixed or programmable pipe line or pixel shaders) cannot cope with the entire frame within the 1/60 sec. period, VSYNC drops down from 60FPS to 30FPS abruptly. When such drops are momentary due to camera movement, image stutter is inevitable.
My XANEngine was dynamically watching the FPS rate and switched off VSYNC below 60FPS immediately, allowing for my custom calibrated timing procedures written in asm to take over in order to ensure smooth rendering until the camera retuned into a 61FPS area where 60FPS VSYNC would be switched on again.
Slight image tear potentially seen while the scene runs un-VSYNC'ed is a much lesser evil than image stutter caused by abrupt toggling between 60 and 30 FPS.
Modern
adaptive VSYNC'ing implements this strategy within a contemporary OpenGL driver directly. The magic number is -1 which you use to set your VSYNC to 60FPS as usual. As soon as the FPS rate drops below 60, OpenGL switches VSYNC off entirely and your application is expected to run un-VSYNC'ed. When the camera comes back to areas that are easier to render, a 60FPS VSYNC is switched on again automatically.
Does XP opengl require any sleep time, or is this a normal part of VSYNC'ing?
No, Sleep() calls with their associated timeBegin/EndPeriod() are there only to satisfy your aspiration for zero CPU load. They are not either necessary or welcome for OpenGL's own timing or VSYNC'ing.
Matter is, immediate mode and draw lists are deprecated features in the OpenGL standard. There have been several attempts to declare them legacy techniques and exclude their support from the standard altogether. Yet it didn't actually happen for the reasons of backwards compatibility and educational/promotional importance. These techniques are however not being optimised in, or further developed for, the modern GPU's any more.
If you switch your rendering to vertex buffer arrays and fixed or programmable pipeline (texture units), you will see your CPU usage drop close to zero at 60FPS VSYNC at no extra programming costs. Once created and uploaded to the GPU, vertex buffer arrays can also be erased from conventional memory. Static vertex data will not be sent from the CPU to the GPU along the data bus any more and there will be only minimum activity on the CPU side of data bus to switch OpenGL's client-side states related to VBO and texture selection.
This is how the CPU and data bus loads would compare in my profiler in real-time deployment of XANEngine to render a fully textured static scene with approx. 250K non-culled polygons in view (CPU - long blue bar, data bus - long cyan bar):
The leftmost snapshot employs an RDTSC-based timer with finely calibrated mixture of Sleep(1) and Sleep(0) calls in place of VSYNC=60. In all the three cases, a fixed pipeline of 4 texture units is used to render diffuse+bump+gloss+lightmap textures in one pass and a post-processing pass is added to cover the entire canvas with a tinted quad to simulate the light volume the camera is currently in. A x4 antialiased x4 anisotropic canvas is used with 5 max. mipmap levels of texturing.
Finally, in a multi-threaded vertex and pixel shader application 99 per cent of rendering activity will be shifted to your GPU. Your CPU cores will go Cool'n'Quiet while your GPU fans will be roaring like a Boeing and you will start to meditate in all seriousness about the benefits of liquid nitrogen cooling. At that very moment you shall finally learn the attributes of a true gamer's nirvana.
Using PeekMessage, I'm now getting good results without using ARB calls, sleeps or timers (CPU load 3%)
Excellent!