Archived

This topic is now archived and is closed to further replies.

bondi

OpenGL animation with MFC

Recommended Posts

I''ve written a simple program in WIN32 Console Application that rotate always a triangle until the user quits the program. I''ve use glutIdleFunc(func) to increase the rotation angle and glutPostRedisplay() to refresh the display. Now I want to write the same program with MFC-Application. Can I use glutIdleFunc(func) and glutPostRedisplay() ? Can somebody help me ? bondi

Share this post


Link to post
Share on other sites
Um no I don''t think glutxxxx will work with MFC.
The easiest thing to do, is to create a timer (via SetTimer), and handle the ON_TIMER event.

Or, if you really want to use the idle time, you need to make your window modeless, and then CApp has an OnIdle method you can override. There was an example on msdn.microsoft.com showing how to do this.

It''s a much cleaner solution, imo, to create a seperate thread to render the graphics.

Magmai Kai Holmlor
- Not For Rent

Share this post


Link to post
Share on other sites