• Advertisement
Sign in to follow this  

Is GLUT a good idea?

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

Well I'm learning OpenGL for a game engine I'm making and I'm not sure if it's a good idea to use GLUT or not. All I really need is basic control over a window like size, title and icon but is there any reasons not to use GLUT such as performance or compatibility?

Share this post


Link to post
Share on other sites
Advertisement
Well - GLUT is good in the beggining. But as you progress throw the project you will realise you maked a bad decision using glut. If you dont want to get into details when creating window, control and other input stuff, i recomand one of the fallowing. SDL, SFML ....- SFML is very easy to use. Also SDL. You have to decide which fits you best. But i think you should use something that lets you create menus, have dialog boxes, open dialogs and stuff. You will come to need them. So QT, Gtk (with gtkmm for c++ binding) are the best thinks to use for window and input. For stuff like sound, image open for textures you could still use sdl or sfml.

Good luck with your engine

Share this post


Link to post
Share on other sites
I've found (through testing and working with many different varieties of GLUT) that GLFW (GLFW at SourceForge) is the cleanest, easiest and overall most optimized framework to use.

GLUT is great for beginners, like in "What is OpenGL"-beginners, but as guvidu said, you will soon understand that GLUT has a VERY bad design and takes away too much of the control.
You simply pass functions to GLUT and it does everything, you have no real insight into what happens and you have very little control (other than restricting how often your code can occur inside its own function) - GLFW lets you set up everything yourself, and it is just as simple. Yes, for the same functionality in a program your initial work will be a few lines longer, but that is simple program logic (id est: setting up your own loops and limiting updates, etc, nothing fancy or difficult), and the control you get in return is VERY worth it.


I'm currently working on a project on my free-time with some people from my university. We're in the beginnings of a space "tabletop"-strategy game, and we're using an "engine" I wrote for my assignment last year. It's up on CodePlex (Ragnarok Project) and Open Source - you're free to grab a copy and take a look at how I used GLFW to open a window, get ready for drawing, polling for user input, etc.
Now, I'm not saying I did a fantastic job, or that this is how it should be done, but it is a collection of a few simple wrapper-classes that use GLFW to achieve the required functionality.


Best of luck on your engine!

[Edited by - CodeLuggage on August 1, 2008 5:29:51 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by guvidu
Well - GLUT is good in the beggining. But as you progress throw the project you will realise you maked a bad decision using glut. If you dont want to get into details when creating window, control and other input stuff, i recomand one of the fallowing. SDL, SFML ....- SFML is very easy to use. Also SDL. You have to decide which fits you best. But i think you should use something that lets you create menus, have dialog boxes, open dialogs and stuff. You will come to need them. So QT, Gtk (with gtkmm for c++ binding) are the best thinks to use for window and input. For stuff like sound, image open for textures you could still use sdl or sfml.

Good luck with your engine


I will never need menus or dialog boxes because the game will probably be running in full screen but I may use the inputs for my game. I was thinking this will make the code more simple and to the point.

All I really want to know is if this will make my program run any slower and if the inputs would be usable for a FPS. Like if the mouse axises are only absolute it would be useless to me.

Share this post


Link to post
Share on other sites
After looking over it a bit more I'm starting to think it offers to many features. I don't really see the point of adding it when I have perfectly functional code just to make the code look neater.

Share this post


Link to post
Share on other sites
you say you dont need those things now - becouse you run in fullscreen - but what if you decide to make a game editor for your fps style game. You should look at the big picture, not only at what you need now. It maybe harder to implement at first - but then it will be easy on you to make modification. Glut is a low level api - the frames per second might be enough for you - dependif of what you want in a game. I suggest you make a wrapper class for windows and input over glut (if you decide to use glut) and if you get into troubles just change that wrapper that wrapper class to use something else (sdl or GLFW).

Share this post


Link to post
Share on other sites
Quote:
Original post by EmptyVoid
After looking over it a bit more I'm starting to think it offers to many features. I don't really see the point of adding it when I have perfectly functional code just to make the code look neater.
Input is the real problem with glut - in particular the key callbacks hand back different characters depending on whether shift or capslock are down, which is a complete pain. I would recommend moving to GLFW (for pure simplicity), or even SDL, in the fairly near future.

Quote:
Original post by guvidu
But i think you should use something that lets you create menus, have dialog boxes, open dialogs and stuff. You will come to need them. So QT, Gtk (with gtkmm for c++ binding) are the best thinks to use for window and input.
Why add all that complexity, when you don't need it? I don't recall ever seeing a game using either of those. Editors, very occasionally, but always as a separate app from the game itself.

And that is not to mention the issue of increasing the size of your distributable by 5-10MB, once you manage to wrestle QT/WxWidgets/GTK into a re-distributable form (not an easy task on many platforms).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement