glutpostredisplay works on one machine, but not the other

Started by
2 comments, last by Way 11 years, 4 months ago
Using Visual Studio 2010, my animation works fine on my laptop, but only draws the first frame on my desktop. Both machines have freeglut and I'm almost certain they're properly installed. I tested a smaller program and glutpostredisplay() works fine. I've also included freeglut.lib in the linker settings. Am I forgetting something? I know the program is running because the keyboard callback functions are telling me that the draw method is being called.

Any guesses as to what might be difference between the two machines?
Advertisement
This is weird. I ran my program from remote desktop (from laptop to tower) and the window was actually being updated, although choppy. I left the program running while I closed the remote session, logged into the tower itself (non-remotely) and the window was still being refreshed, although with a framerate even slower than the remote session.

Is this setting off any red flags for anyone? Because I have no idea what is going on.

So the animation works, barely, via remote session, but only displays a single frame, otherwise. I guess I'll try to update the desktop's GPU driver?
The remote desktop session is definitely using software emulation.

My bet is that you've created a single-buffered context which is working fine on your laptop but not on your desktop. You can easily confirm that - your glutInitDisplayMode call will have GLUT_SINGLE, and you won't be calling glutSwapBuffers anywhere. At this stage I'm going to go all psychic on you and guess that your laptop has XP and/or older D3D9 class hardware, or - if Vista/7 - you have the DWM disabled.

The best solution is to just create a double-buffered context instead. That's not difficult (so I've no idea why most GLUT tutorials don't seem to just do it) - just use GLUT_DOUBLE instead of GLUT_SINGLE when creating, and call glutSwapBuffers at the end of each frame.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Success! @mhagain While you were absolutely right about the double buffering, your psychic abilities must have been receiving some interference as the laptop is running Win 7 but I don't think DWM is disabled. If it were, I wouldn't have the fancy windows effects, right?

Is there ever a reason not to use double buffering or can I just use that from here on out?

This topic is closed to new replies.

Advertisement