Jump to content
  • Advertisement
Sign in to follow this  
AtmaWeapon

Glut without Display Function

This topic is 4505 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
Advertisement
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
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!