PDA

View Full Version : How to implement this without Glut



wzhao53
12-01-2003, 08:32 PM
For example, I used glutIdleFunc(), sleep() and glFlush() to print some letters one by one on the graphics. I also used single buffer to make it work.

If I can not use glut, how can it work at the same way? Any simple sample codes? Nehe has too much codes....

Thanks!

mikael_aronsson
12-01-2003, 11:08 PM
It all depends on your OS...

On windows you can replace the glutIdle() with an idle handler in the message loop (win32) or using the Idle() method (MFC).

Sleep() is used to do delays the ugly way.

And glFlush is already on OpenGL function.
(SwapBuffers is used to handle doublebuffering on Windows).

Mikael

nexusone
12-02-2003, 05:02 AM
There are many way's in which to create the effect you want, but depending on what you want to program to do in the future. How you are doing it now will limit you options.

GLUT is the simplest way to create an openGL program. If you are having trouble with using GLUT, then you may want to study more.

I think that a better understanding of how openGL and programming in general would help you with this.

Start with nehe's tutor 1 and work your way up, to get a better understanding of programming openGL.

cwc36
12-04-2003, 12:39 AM
Hi,

You can replace the glutIdleFunc with TimerFunc. That will work.