How to display items without using glutDisplayFunc()? What exactly does its code do?

Hi guys, I’m new to programming and OpenGL. I try to understand from the ground. Most tutorials I’ve read so far are based on glut. I’m wondering how to write codes without using glut? What exactly do those functions do?

For example, I’ve defined a display() function. If I use glut I can simply write “glutDisplayFunc(display); glutMainLoop();” in the main() function to call the display(). But if I do not use glut, what should I do? What do the code look like?

If I work on a MFC/Qt project, there is no main() function. What should I do?

Thanks!

[QUOTE=loonger;1261152]Hi guys, I’m new to programming and OpenGL. I try to understand from the ground. Most tutorials I’ve read so far are based on glut. I’m wondering how to write codes without using glut? What exactly do those functions do?

For example, I’ve defined a display() function. If I use glut I can simply write “glutDisplayFunc(display); glutMainLoop();” in the main() function to call the display(). But if I do not use glut, what should I do? What do the code look like?

If I work on a MFC/Qt project, there is no main() function. What should I do?

Thanks![/QUOTE]

All this glut functions are needed to create a context, otherwise you should use windows api or the one for linux, i think they are x windows but, the point is that using (or glfw or whatever library you want to use) avoids you tens of lines of code.

This is not in modern opengl but you’ ll get the idea:

About Qt i’m not the right person since i never use it, you should try searching on google a tutorial on how to create a context in Qt

Thanks Ruggero.

you’re welcome