Sign in to follow this  
tums

Switching to a non-GLUT window/thread

Recommended Posts

Hello, This is my set-up: I have a multi-threaded Windows program (not console and I don't have a main function) that opens up a GLUT simulation window in one thread. My control as well as my data update are carried out by other threads that are in other classes. They have nothing to do with my glut simulation window except start it and pass a variable to refresh the simulation. I need my simulation thread to update my simulation window using that passed in variable but that relies on the control thread. How do I transfer processing from the simulation thread to the control thread to calculate this variable? Everything seems to be working fine except this small detail....;) Thanks for the help.

Share this post


Link to post
Share on other sites
I think I did something similar to what youre talking about, but I'm not clear on some of the terms you introduced. Explain what 'data update', 'control', 'simulation thread' mean in more detail. If I was clear on that, I may have a design pattern already worked out that you could use.


Are you saying that you have one thread computing data, while the GLUT window displays a visual representation of the data?

Share this post


Link to post
Share on other sites

I have one thread gathering data from a simulation file, a second thread performing calculations on that data and producing a movement. That movement then gets sent to the simulation thread to move my model on the screen.

I think there is something wrong with how i'm updating the movement in my veiw class, but I can't figure out what.

Thanks for the help.

tums

Share this post


Link to post
Share on other sites

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