I’m pretty new to programming in opengl, I’ve been learning mainly from the red book.
should I or should I not be using glut? I’ve heard it’s better to just learn to do things without it as it is slow and offers little customization. however, I’ve yet to find a good example on how to set up a window or set it fullscreen using a console application without glut.
GLUT is wonderfull because it lets you test your opengl without messing up with the windows system.
I’ve never heard a complain about it being slow, altough by definition it must be slower. Nevertheless any application can benefit rfom using GLUT in the early stages. If you’re really looking for developing openGL apps, my advice would be to start with GLUT and when everything is working as it should remove GLUT and implement the windows code. If you separate the rendering from the windows commands then this should be pretty straight forward.
Glut is nice because it is portable across many systems.
I also don’t think it is any slower(or faster) than other options (such as MFCs, etc). (At least I havn’t run across any real preformance problems using it).
This is a newbie question, but I guess that’s what this forums for. Where do I get GLUT? If you could also tell in short terms how to connect it to the compiler (I use MS Dev. studio C++), I’d be most gratefull.
Plz disregard my last post. I have gotten it to work now. If I’d realized sooner how easy it would be, I wouldn’t have posted in the first place. Well, I guess that’s what you get when you act before you think. Sorry for wasting your time.
ok, another question about glut. is it neccesary to use glutMainLoop()? sounds like a wierd question, but when I use it, it seems difficult to do things other than the display stuff. theres glutIdleFunc(), but the glut documentation states that there shouldn’t be much code put into there, so where does your programs main non-display processing go? any way to input into the glutMainLoop() other than the predefined callbacks?
you register your callback functions to do specific things within your programs.
ie,
glutMouseFunc() for button presses
glutKeyboardFunc() for keyboards
etc
glutIdleFunc() is pretty much essential for animations and movement (you need your computer to redraw the frame if its not doing anything. You can process your data in there and then call glutPostRedisplay() to draw the screen)
As for the barest minimum (as far as I’m aware) glutDisplayFunc(); and glutMainLoop();
are absolutly essential. (and the other stuff like glutInit() etc).
Checking out the glut.h file is a good idea ocassionaly, you can often find some interesting functions…