OpenGL and GLUT

Started by
5 comments, last by password 18 years ago
I searched around for a while for answers when I came around something interesting. I was thinking of learning openGL but there aren't so many tutorials that are so good about sdl and opengl. I've wanted to know for a while if it is possible to code opengl or any other api similar like directx without knowing any secondary api like win32 or sdl. After some searching I found GLUT and read about it to get an understanding of what it is. The understanding I got from the text was that GLUT is used to code opengl without knowing any other api and it's the same as opengl and is able to create the window and handle input which is not possible else in opengl. Another understanding i've got, is that it's better to use opengl to code 2d games than the 2d api's itself, if we exclude 3d. Isn't it better to learn opengl directly if you want to code 2d because it's superior at that point too, then you can step up to 3d without as much worries. What do you think of opengl and glut i've never heard about it before so I wonder if it really is any good combination, want your options..
Advertisement
GLUT or openGL Utility Toolkit is often used by opengl programmers. It provides an easy way for people to focus on learning opengl on a variety of different OS's. GLUT mainly focuses on creating the opengl window for you and then you can focus on what you want to draw in that window. Without GLUT you need to know how to create a window and bind opengl to it for whatever OS you are using. With GLUT you can compile the same code on multiple OS's without changing a thing and it will only take you a handful of function calls to get things ready for drawing with opengl.

Do a search on GLUT samples, you will notice they all have a similar structure to them.

Hope this helps.
glut is really used for learning, and for making cross-platform sample/tutorial programs etc. i personally skipped it because long before learning OpenGL i knew the win16/win32s (back in the Win32s -> Win95 transition days) api fairly well. i recommend skipping glut and just forcing yourself to learn windows/linux programming.
Quote:Original post by yadango
i recommend skipping glut and just forcing yourself to learn windows/linux programming.


I strongly disagree. Do you want to develop windows/linux applications or games? Skip the BS and use a media layer like SDL/Glut/GLFW to do the OS specific crap and get to the part you want to do. Make a game.
I highly recommend using GLUT for the first 2 weeks - 6 months while leanring OpenGL, because you can get your basic mouse / keyboard stuff working in ONE NIGHT ... and copy and paste it to future programs in less than 1 hour. Allowing you to concetrate on the stuff you are trying to learn first.

Then when you have basic to decent OpenGL knowledge and you want to get into other stuff (like sound, joysticks, platform stuff ... etc) you can replace build your app in the system of your choice (Win32, SDL, Linux, ...), and migrate over your working OpenGL graphics pieces.

Some APIs I personally consider worth considering:

OpenGL, GLUT, DirectX, SDL, OpenAL, ...
If you really want to use a cross-platform windowing API, use GTK. It works with openGL and is fairly easy to use (similar to creating windows and stuff in java). I suggest using GTK because for one, it is still actively supported, whereas nothing new has happened to glut in a couple years.
I'll go with SDL because that is what i'm most used to. I just realised that the window is almost the only thing that is important too. But when you're coding OpenGL using SDL, is there any extension libraries or some other thing you need to learn, or is it the same as working with win api and what about rendering context and that stuff?

Thanks for your comments..

This topic is closed to new replies.

Advertisement