Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

a2k

what are GLUT's disadvantages?

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

what''s bad about GLUT? i haven''t heard anything bad about glut, but i''m sure there are some bad things about it. i thought it was just a nice encapsulation of gl.h and glu.h. anyway, what''s up? a2k

Share this post


Link to post
Share on other sites
Advertisement
GLUT basically just a lot of system-dependent functionality. Things like window creation and mouse and keyboard input. So, obviously, all of your GLUT code is portable, just like your OpenGL code. Advantage. =)

The disadvantage to it is that, since those functions have to be platform-independent, their implementation isn''t quite as powerful or feature-rich as what you''d find in the operating system''s own API. Also, you can''t do things like setting the resolution (unless you have some special version of GLUT I''ve heard about)--in other words, making an app full-screen in GLUT means making its window take up the entire screen. Probably the biggest problem with GLUT is that it doesn''t seem to be a standard component so not only would you have to download it, but any of your end users would have to obtain it somehow, too. Annoying.

I''d recommend using GLUT for anything small and/or personal. Otherwise, do it the "real" way.

Share this post


Link to post
Share on other sites
I second that!

If you absolutely, positively need platform idependence use GLUT. Use GLUT to experiement with, it helps keep things clear. When you''re ready to ''publish'' as it were, use win32 and wgl.

Paul Groves.
http://home.clara.net/paulyg
OpenGL for Beginners

Share this post


Link to post
Share on other sites
thanks for making me understand it. actually, NeHe''s full screen example code is a good place to start, am i wrong? do you think this is a good start?

a2k

Share this post


Link to post
Share on other sites
I used to recommend GLUT, but it is currently in an unsupported state (as of GLUT3.7 beta) and it doesn''t look like it has any clear direction when it comes to adding any new features. Sure, whats there now is great, but it could use some work.

For people looking to GLUT for OS abstraction, I''d suggest they take a look at SDL (http://www.devolution.com/~slouken/SDL/) in addition to GLUT and see which meets their needs better right now, and which is more likely to grow where they''d want it to grow in the future.

Share this post


Link to post
Share on other sites
Ahh, so that''s what SDL is! I''ve been out of the loop for a while and saw it mentioned in another thread...

Paul.

Share this post


Link to post
Share on other sites
Biggest problem I found with GLUT was that there was no way to elegantly break out of the main loop, which is contained in the library itself. Your program basically runs until somebody hits the close box or you call exit() --in either case, anything allocated dynamically is screwed.

Thankfully, the source is included, and it''s an easy fix. Just write up a function that sets a global flag, and make sure that the main loop checks the flag as it goes.

Share this post


Link to post
Share on other sites
Hi everyone,

This is sort of related... does anyone know if you can get relative mouse coords from GLUT, or set the mouse coords? (I can't find a way, and I've been looking for ages)
Just curious.

The mouse thing above, and the main loop thing that johnhattan mentioned, are my main gripes about GLUT. Other than that, it's quite good for spanking together an OpenGL app (be it tool, simple game, whatever), and is very simple for beginners to learn (its what I used to learn, rather than aux).

PS: you can run GLUT in fullscreen, by calling glutFullscreen() (strangely enough...) after you create and initialise the window. A resize event will restore it to windowed mode again.

-------------
squirrels are a remarkable source of protein...

Edited by - Bad Monkey on 4/11/00 8:41:10 PM

Share this post


Link to post
Share on other sites
oh, yeah.
thanks, bad monkey, but is it still unsuitable for game programming?

a2k

Share this post


Link to post
Share on other sites
I''m actually building a terrain engine at the moment built around GLUT... its just fine, except for the damn mouse... when you go to use mouselook, and you turn long enough in one direction, the mouse cursor position eventually hits the edge of the screen, and you stop turning (I base rotation on the difference in absolute position of the mouse, ''coz I can''t get relative values). Its a real bitch.

Basically, I can''t be bothered setting up a proper win32 app (I keep telling myself its better to have OS abstraction... what a load of bollocks. I''m just lazy ).

You can try and use it for games, but its probably better in the long run (i.e. when you want to make more advanced games) to use the native framework (win32, X, whatever).

-------------
squirrels are a remarkable source of protein...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!