I just came back to doing 3D stuff after a hiatus of six months or so, because of an idea I had one day.
So I spent about a day putting that idea together, using stuff I’d previously coded as a guideline, because all that works fine.
Now here’s the problem: there is a significant and noticable delay between when the code is being executed and when it is rendered, almost a full second. I don’t have very good frame rates (25-25 fps), but that is not the problem: the problem is, if I (for example) move the mouse, hit a key, etc, this event is logged IMMEDIATELY on the console (via printf) but in the OGL window, it does not occur for a noticable delay – so noticable, I can move the mouse quickly for say 1/2 second and the display doesn’t start moving til my hand is off it. Parallel to this, if I put a condition in to flash an object red every few hundred frames and count ticks in the console, the object actually flashes about 15-20 frames AFTER the code has been executed, going by the console output (nb – please, don’t bother me w/ remarks about this methodology).
Now, here’s the clincher: my old code, that I used as the template for my new code, does not have this issue at all. Console output and the display are perfectly syncronized, I can move the mouse and there is no delay, etc. The only difference between the two is that the old code uses lighting and texture, whereas I have not added that to the new code yet.
Anyone have any idea why this could happen – that is, how I would end up with the display lagging 15-20 frames behind the execution?