Jump to content
  • Advertisement
Sign in to follow this  
methinks

OpenGL Bypassing the glutMainLoop

This topic is 3922 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

I'm just getting into Linux programming, and I haven't touched Opengl in a while, so I'm a bit rusty... Is there any way that I can use OpenGL to render without calling glutMainLoop? The reason that I don't want to use openGL's loop, is that I'm trying to keep the rendering apart from the rest of the processes, which means I don't want to call them from within the rendering loop. I have thought of using glx instead of glut, but I can't find any good documentation (all the tutorials use glut) and glut helps with the portability.

Share this post


Link to post
Share on other sites
Advertisement
If you don't want the infrastructure glut sets up for you, it's probably a really bad idea to use glut. Either set up OpenGL yourself (using glx on Linux), or use another framework, like SDL or whatever else you prefer.

After 20 seconds of googling, I found this bit of documentation.
It was on the OpenGL site, so I somehow doubt you've looked very hard for that glx documentation. [wink]

Share this post


Link to post
Share on other sites
hmm.. must have missed that. I did check the red book, but even that was based off of glut
I think I'll go with SDL. Thanks for the help!

Share this post


Link to post
Share on other sites
Yeah, tutorials and sample code usually use glut, because when all you need to do is demonstrate a small snippet of OpenGL code, it's a lot easier to get up and running.

When you're writing a larger application, glut starts getting in the way a lot. [grin]

Share this post


Link to post
Share on other sites
Quote:
Original post by methinks
I'm just getting into Linux programming, and I haven't touched Opengl in a while, so I'm a bit rusty...

Is there any way that I can use OpenGL to render without calling glutMainLoop?
The reason that I don't want to use openGL's loop, is that I'm trying to keep the rendering apart from the rest of the processes, which means I don't want to call them from within the rendering loop.

I have thought of using glx instead of glut, but I can't find any good documentation (all the tutorials use glut) and glut helps with the portability.


I'm into GLUT as much as SDL, because I think they're both pretty good programs.

If you want to bypass the main loop, take note of which functions the loop calls, and in which order, then just call them yourself. The input callbacks might be a problem though. I'm not sure if they're called if you don't use the GLUT main loop. Never tried.

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!