Advertisement

Is GLUT truely evil?

Started by October 15, 2000 09:01 PM
30 comments, last by The Rainmaker 24 years, 1 month ago
I have spent 6 months programming OpenGL, all triggered by my discovery of NeHe. Ever since then, I have NEVER used GLUT. I actually despise GLUT. Why? Well, it seems to offer all sorts of goodies to you, but when you reach out to grab it, it bites your hand off! Sure, it probably is great for newbies. Nothing sucks more then to write all that tedious win32 code, just for a simple window (heck, I STILL do my best to avoid it, as it is so loooong. GLUT makes it all so simple. Just call the little lot of functions, and it seems to handle it all for you. That is all great until you actually RUN your code, at which time you will realize there is a quite ugly DOS-esk window running behind your semi-ugly render window! I don''t know about you, but having anything that appears to look like dos when I run a game/demo makes me immediatley have the urge to hit the X button. Maybe this isn''t that big of a deal to you, but it affects my initial opinion of the program. Now when I first decided to take a looksie at GLUT, I noticed that the documentation says it is for easy in-program menus. I kept looking for more features, and besides allowing you to cheat out of win32 code that is it! I may be totally wrong, but an entire utility that is meant mainly to do neat menus for your program, which most people don''t even use, isn''t a good thing. I am not totally sure if I am correct. That is why I am making this post! Prove me wrong!! If you side with me, tell me! Thanks for reading. L8r, The Rainmaker Biendschmofan''s Tutorials Of OpenGL Glander
L8r,[email=richardfrazee@msn.com]The Rainmaker[/email]Biendschmofan''s Tutorials Of OpenGL Glander
Rainmaker, there are some advantages over using you''re available API, verses GLUT.. GLUT is available on almost any operating platfrom, so if you''re going for portability, glut is the way to go. It also supports creating menus via you''re API, and a whole slew of other things.. Althow, I''ve found some things are just more convenient to do with Win32 API. And, in reply to the DOS prompt window comment.. That can easily be disabled with a link option in most Win32 compilers. I actually think the dos prompt window is kindof handy.. Gives you an easy way to dump information from you''re OpenGL application.. And makes for a good means of getting keyboard input, without the hassle of creating resources, and dialog boxes in WinAPI. Glut VS Win32API (or whatever platform API you may be using).. They''re really not comparable.
Advertisement
When I used to see GLUT programs, I also got put-off by the console window... and until a week or two ago I had never tried GLUT. And boy am I glad I tried it. I have now started coding in a consistent way. Before I used to think hell, that windows code is ugly as hell, why bother commenting my code? Why bother having a consistent way of naming my variables and functions? With GLUT, theres so little code to create a window and start rendering stuff and its very neat too, that I feel guilty if I don''t remain consistent and comment my code. I also find its a helluva lot easier to whip up programs quickly. And that console window is just so damn useful for debugging!!
I suggest you try out GLUT, when releasing your program you can remove the console window which is probably a good idea. Maybe you''ll like it, maybe not. I know for certain that I do.
Nehe, if you''re reading this... would you be willing to accept GLUT ports of tutorials?
Rainmaker you are not correct at all. The MS-DOS box is a non-factor when it comes to using GLUT. If you actually took the time to read the GLUT FAQ you would see that there is a way to get rid of it, but you passed judgement without reading up. Most people leave it in for debugging, error reporting or just to dump what keys do what in a demo.

"GLUT makes it considerably easier to learn about and explore OpenGL programming." That bit of text is from the "About GLUT" page on OpenGL.org is why you should use GLUT. You shouldn''t be using GLUT if you are trying to get around implementing advanced input, menu systems, pop-up windows, etc, etc in your programs. If you are using GLUT to shortcut having to do more work it should "bite your hand off" as you say. Like many things that you can use GLUT is a tool, its not an all around solution.

In my opinion people who are new to OpenGL shouldn''t be using Win32 code at all. While the Win32 portion is important in the long run, it means very little in your course of learning OpenGL. When you write a OpenGL application the Win32 specific OpenGL code is called once ever time the app runs and that''s it. Why bother focusing on something that happens once when you can focus on how to use the OpenGL API? Once you have a good grasp of the API then you should dive into the Win32 portion and learn how it''s a pain.

Also messing with Win32 code for OpenGL can become a nightmare due to broken drivers or drivers that just don''t function the way they should. If you use GLUT your chances or having a working application are much higher because if a driver doesn''t work with GLUT it''s probably horribly broken as a whole.

The moral of the story is that GLUT is a tool, not a silver bullet. People may argue that it makes you a lazy coder, but it only makes you lazy if you are using it to shortcut things. I have been coding OpenGL for around 3 years and I still use GLUT because its a great tool that makes what I want to do easier.

Nate Miller
http://nate.scuzzy.net
Hell yeah... what Nate said... with apple sauce on it.
Not much more to say than that...

*mumbles some random curses about Win32*

------------------------------------------------------
"You need a weapon. Look around you... can you construct some sort of rudimentary lathe?"
- Guy Fleegman, Security Officer, NSEA Protector
I hate applesauce... Butterbeans rule!
Advertisement
This is an interesting topic.

I think glut is pretty cool.

And it can be useful for lots of things.

It''s not the demon seed.

And it''s not the savior.

I haven''t figured out how to distribute a binary that uses glut without requiring the user install the glut libraries. But I don''t really know if that''s a horrible thing. I would imagine you should be able to statically link it. But I don''t know since I''ve only been programming windows for a few days now.

But I can tell you one thing: I was able to easily port over some linux opengl code because I had used glut on linux and it was also available on windows.

I also found that if I used NeHe code and glut code together (open the window with NeHe but still use some glut utility functions) things work fine. So I wasn''t even aware of the dos window thing. Although I wouldn''t want that happening on my app either.

--
- Aaron
Hey! I''m trying!
I don''t like GLUT, ironically I hav''nt tried it yet But I don''t like it, just because I am under the impression that since it is high level wrapper, it is slow, secondly, there is some sort of pride, going through everyone, that hey! just do it the difficult way. Well anyway correct me about the speed of GLUT, is it relly slow? and does John Carmack use it?
ok i''ve used glut at the beginning, and I really disliked (didn''t understud what function pointers are, and so I didn''t understud how it could work, that whas the only problem)

i''ve found then the Nehe-T on the Net, and it whas best, I could find, because I didn''t know much about programming (started about a month before), and because it''s so low-level, i understood it really fast. Now I''m programming win32 api without opengl, too. For editors, for example, and that couldn''t work while you are useing glut. So try programming in the api of your operating-system, because then you could do EVERYTHING you want (even when the API is stupid.. nothing about win32-api, nono)

and, for the compatibility for other platforms, i just search someone, who has it, because he knows best way to realyze it on the platform. Just useing glut means, you create programs for operating systems, you dont understand, and thats why I hate it.. I want lowlevel, then the only error is build by me...

we wanna play, not watch the pictures

by the way, noting against the glut-programmers, they did really nice work, just to say

and greetings to RainMaker

we wanna play, not watch the pictures

If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement