Jump to content

  • Log In with Google      Sign In   
  • Create Account


To glut or not to glut...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 mv348   Members   -  Reputation: 249

Like
0Likes
Like

Posted 09 November 2012 - 02:13 PM

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?

Edited by mv348, 09 November 2012 - 02:15 PM.


Sponsor:

#2 larspensjo   Members   -  Reputation: 1526

Like
1Likes
Like

Posted 09 November 2012 - 03:29 PM

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.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#3 SimonForsman   Crossbones+   -  Reputation: 5970

Like
0Likes
Like

Posted 09 November 2012 - 03:30 PM

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.
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!

#4 mv348   Members   -  Reputation: 249

Like
0Likes
Like

Posted 09 November 2012 - 03:56 PM

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.


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


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...

#5 larspensjo   Members   -  Reputation: 1526

Like
2Likes
Like

Posted 09 November 2012 - 04:45 PM

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.

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


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


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.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS