Jump to content
  • Advertisement
Sign in to follow this  
Ashe

GLUT and GetOpenFileName

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

Good evening everyone, I would like to ask you for advice. I am using GLUT window and GetOpenFileName to show dialog for opening file, but if the dialog is displayed the GLUT window is not being repainted. Thanks for any advice Ashe

Share this post


Link to post
Share on other sites
Advertisement
As with all Windows Common Dialog's, it is a blocking operation since it has to wait for a response before moving onto the next line of code. Therefore, you will not be swapping buffers (and hence, repainting the screen) whilst a Dialog is open.

The way around this is to have your rendering done in a separate thread.

Share this post


Link to post
Share on other sites
Thanks, I supposed it. Is there some easy way how to redisplay in another thread while using GLUT.

Thanks.
Ashe

Share this post


Link to post
Share on other sites
It might be easier to leave your OpenGL rendering in the main thread, and put the open file dialog in another thread.

I'm not even sure if that's possible with GLUT, because of its mainloop and callbacks mechanism that kinda takes over your program structure.

It's definitely possible with something like GLFW, however. It even provides threading support.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!