To glut or not to glut...

Started by
3 comments, last by larspensjo 11 years, 5 months ago
I'm going to be modifying the source code from these tutorials (Now available as Visual Studio 2010 Project files. YAY!) and use it as a code base for my graphics engine. These tutorials use glut to handle windowing and callbacks. I always used the Windows API for my OpenGL applications because my understanding was that it was the 'grown up way', it offered more flexibility and customization, and also glut seemed to be fading into obscurity, at least on Windows. But I'm trying to determine if its worth the effort to remove GLUT and replace it with direct Windows API calls. In the future I hope to make use of some type of Game-pad and I don't think glut offers a whole lot of options for that. More specifically, I don't believe it supports force-feedback and I'd have to use a more advanced input API. I'm not sure if glut would play nice with that, given its current input and callback mechanisms.

Can I hear some opinions? Is it unprofessional to use GLUT in a modern application? Will it hold me back in any way?
Advertisement
I suppose you mean freeglut, and not glut. Glut is indeed very old and not supported.

Personally, I prefer glfw instead of *glut. But glfw doesn't support fore-feedback either (though it is considered for 3.0). I feel glfw as a more mature library than *glut.

The tutorials you link to seem to be "almost" up-to-date, but not completely. They are not using Vertex Array Objects, which is mandatory from OpenGL 3.

For a very good, minimal example, see https://github.com/progschj/OpenGL-Examples. Starting from the basic, to advanced. They are minimal in the sense that every example is only one file, and does only just what is needed and nothing more.
[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/
glut was originally made to support the OpenGL redbook examples (without having to deal with platform specific code), it is not a complete API and shouldn't be used in serious applications and yes it will hold you back. (main problem imo is that it takes over the game loop)

Personally i wouldn't use the Windows API with OpenGL either since it is a pain in the ass to write platform specific code (and AFAIK Win32 doesn't include force feedback support either, you probably have to use DirectInput on Windows for that), something like SFML + OIS might be a good combination though.
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
Thanks for your responses!

The tutorials you link to seem to be "almost" up-to-date, but not completely. They are not using Vertex Array Objects, which is mandatory from OpenGL 3.[/quote]

I did not know it was mandatory (Is it really? In the sense that it won't even work?) But they introduced VAO's back in Tutorial 32 and have used them from there on.

So yes, let us clarify, turns out it is in fact FreeGlut that the tutorials use for Windows.


Personally i wouldn't use the Windows API with OpenGL either since it is a pain in the ass to write platform specific code
[/quote]

Really? I thought it would be harder to make my code cross-platform compatible than to just go with a single platform.

So I'd need DirectInput for force feedback? Hmm.. that's annoying...

The tutorials you link to seem to be "almost" up-to-date, but not completely. They are not using Vertex Array Objects, which is mandatory from OpenGL 3.


I did not know it was mandatory (Is it really? In the sense that it won't even work?) But they introduced VAO's back in Tutorial 32 and have used them from there on.[/quote]
It is possible to use OpenGL in compatibility mode, where legacy API is available. This support is probably not going to go away for a long time yet, so it isn't much of a problem. As you already understand the VAO, it looks to me like a good tutorial. As long as it isn't based on immediate mode, I think you are fine.


Personally i wouldn't use the Windows API with OpenGL either since it is a pain in the ass to write platform specific code
[/quote]

Really? I thought it would be harder to make my code cross-platform compatible than to just go with a single platform.
[/quote]

If you are used to Windows API, it may well be easier. I don't know the Windows API very well, and find glfw (or glut) is easier to use. And then you get portability at the same time.
[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

This topic is closed to new replies.

Advertisement