Sign in to follow this  

ai / physics within a glut program

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

i was wondering where the best place to put the ai/physics updating code is. i have considered the idle call back, but i'm guessing that isn't a great idea. another thought that came to mind was to use the display call back, but again, that just doesn't seem to be a good idea. any suggestions? thanks!

Share this post


Link to post
Share on other sites
that is honestly the response i expected due to the fact that glut takes almost complete control from the developer (of the main loop and event handling).

well darn. any suggestions on a better framework? i looked into sdl but i have no idea how it works with glut (because i couldn't seem to find a tutorial/example that laid out the basics). i also looked into allegrogl, but again that one didn't seem to have much documentation on how to it works. i'm thinking i might be able to use allgerogl the best because i have experience using allegro (and actually like it), but without much documentation on how it interacts with gl, i'm kinda stuck. and when you said make my own framework, you are talking about doing what NeHe does -- build the winmain/proc yourself and deal with all those messages individually, correct? that would be possible, but i personally would like the crossplatform otpion. so, what other frameworks are out there? and, where might i find good intro materials for the frameworks mentioned or suggested?

thanks!

Share this post


Link to post
Share on other sites
My personal favorite crossplatform windowing framework for OpenGL is GLFW. I think you'll find it similar to GLUT while giving you the freedom to control your own main loop (bonuses: crossplatform threads, nanosecond timer). There are tutorials right on the main page.

SDL does not need to work with GLUT. I assume you're using either C or C++? There are several tutorials available for setting up an OpenGL window using SDL.

For loading extensions you'll want to use something like GLEW.

There are OpenGL bindings for other languages if you aren't or don't want to use C or C++. Look at PyGame for a Python wrapper around SDL. You'll need PyOpenGL, and probably (though not necessarily) the Python Imaging Library. There's also GLEWpy.

Try the Alternative Game Libraries Forum FAQ for more resources. Also, the Ogre3D wiki has lists of resources on general topics as well as content creation.

Share this post


Link to post
Share on other sites
i would use glut. The most simple solution is this:
1. render the frame in the render function
2. at the end of it call functions to compute the physics and ai

the only problem is now synchronize it all together and this is not glut busines anymore. I would do it this way. If not use WGL ;-D.

Xor

Share this post


Link to post
Share on other sites
well, i have switched to glfw for a couple reasons -- i can define my own main loop and because it supports multi-threading. the reason i like the defining my own main loop is because i like being in control. :) the mult-threading will be nice because if at some point i want to reuse this code for another game/app i can then throw slower calculations into another thread (like physics and ai, or even background loading of upcoming levels).

and yes, i'm using c++. :)

one last question -- what exactly are opengl extensions? i have looked at glew but didn't seem to see what it offered to me since i don't know what the opengl extensions are.

thanks for the input/help so far!

Share this post


Link to post
Share on other sites

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

Guest
This topic is now closed to further replies.
Sign in to follow this