Jump to content
  • Advertisement
Sign in to follow this  
Way

glutpostredisplay works on one machine, but not the other

This topic is 2061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!