Sign in to follow this  

Glut without Display Function

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

This may be a dumb question. Is it possible to draw to a glut window without using a glut display function? Anyone know how to do this? Could I write my own display loop? I tried writing a draw loop ending in a glutSwapBuffer() but that doesn't seem to work. The normal glut window doesn't even pop up.

Share this post


Link to post
Share on other sites
You can't. The window is hidden until you enter the main loop and you can't enter the main loop without a display function. And since you don't have access too the window handles, you can't write your own main loop either.

Share this post


Link to post
Share on other sites
Quote:
Original post by Brother BobYou can't..... And since you don't have access too the window handles, you can't write your own main loop either.


that depends entirely on which version of glut you are using. If you get freeglut or openglut, you can write your own main loop using glutMainLoopEvent() & glutLeaveMainLoop().... (and use can use the win32 func FindWindow() to get the HWND).

Share this post


Link to post
Share on other sites
I've done it before, I used an open source version of glut and had to modify the display function. Somewhere in there it says for(;;) which is an infinate loop. And I just commented that out and the display function returned giving me my thread back. I just kept making that call in my own loop to keep everything on the glut side up to date. Then I realized how silly that mess was and decided to just write my own Win32 wrapper with all the functionality I could ask for.

Share this post


Link to post
Share on other sites

This topic is 4203 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this