Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


glutpostredisplay works on one machine, but not the other


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Way   Members   -  Reputation: 105

Like
0Likes
Like

Posted 28 November 2012 - 11:08 PM

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?

Sponsor:

#2 Way   Members   -  Reputation: 105

Like
0Likes
Like

Posted 29 November 2012 - 12:58 PM

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?

#3 mhagain   Crossbones+   -  Reputation: 8284

Like
1Likes
Like

Posted 29 November 2012 - 02:02 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 Way   Members   -  Reputation: 105

Like
0Likes
Like

Posted 29 November 2012 - 05:26 PM

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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS