Announcement: Be excellent to each other.


Caravel Forum : Other Boards : Anything : Anyone familiar with OpenGL/GLUT? (To all you experienced programmers..)
New Topic New Poll Post Reply
Poster Message
TripleM
Level: Smitemaster
Rank Points: 1373
Registered: 02-05-2003
IP: Logged
icon Anyone familiar with OpenGL/GLUT? (0)  
I mainly program in java, but I've been trying to convert a little java game to C++, using openGL and glut. I'm a bit lost as to how to get everything structured properly with glut.

Basically, this is a turn-based game, where you click on various things to set up how fast things move etc, and then you click go. Everything will then simulate and move around for a certain time, and then its the next turn, etc.

In java thats easy. You have your panel, you set up a timer which simulates the next step and then calls repaint() at all the right times. What about glut?

Once you enter the main loop, you can never get out of it (although I found freeglut, which allows some extra things, which are probably what I want). So how do you actually get the rest of your code to run when you want it?

From what I read, to get animation working properly you set the glut idle function to rendering everything so that it still draws when nothings happening. Do I put, say, if (should be simulating) simulateTheNextStep() at the end of the render method? It just doesn't feel right, for some reason. Maybe that does work though.

It feels like all that should be running in a whole separate thread, like it does in java, while the rest of the program does its job, but I can't seem to find anything online which says thats the way to go.

So if anybody knows how you structure anything like this with glut.. help?
12-24-2005 at 01:48 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Other Boards : Anything : Anyone familiar with OpenGL/GLUT? (To all you experienced programmers..)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.