difference of freeglut vs glew?
Asked Answered
N

2

53

I've recently started learning OpenGL (> 3.3) & I've noticed a lot of examples & tutorials use both freeglut & glew, but don't really explain the difference at all. The best description I've found, after googling & reading ad nauseum, has been this OpenGL Related toolkits and APIs but found it lacking. I've even read the tag info on SO.

As someone really new to OpenGL I'm still trying to get a grasp of the different concepts. I've gotten to the stage of creating a basic program that uses glew, create context (on windows, VS2010), & draw really basic shapes, all without the need for explicitly including freeglut. So I don't understand why I would need it.

So my question then is, what's the difference between:
-freeglut
-glew
-(& glfw)
What can one do that the other can't?

Nathanaelnathanial answered 25/3, 2013 at 11:38 Comment(1)
But that's just it, as I've stated already, all the examples & tutorials I've read etc, don't make it really clear to a beginner what they actually do, hence my confusion. All the examples use functions etc, but don't actually state what one can do & the other can't in any clear fashion.Nathanaelnathanial
I
69

The OpenGL Extension Wrangler (GLEW) is used to access the modern OpenGL API functions(version 3.2 up to latest version).If we use an ancient version of OpenGL then we can access the OpenGL functions simply including as #include <GL/gl.h>.But in modern OpenGL, the API functions are determined at run time, not compile time. GLEW will handle the run time loading of the OpenGL API.About GLEW see here

GLFW or freeglut will allow us to create a window, and receive mouse and keyboard input in a cross-platform way. OpenGL does not handle window creation or input, so we have to use these library for handling window, keyboard, mouse, joysticks, input and other purpose.

GLFW and freeglut are alternative for us according to our need we can choose any one but GLEW is different from them which is used for run time loading of the OpenGL API.

Indescribable answered 25/3, 2013 at 15:21 Comment(0)
W
3

I'm using both of them for some work at my university.

GLEW is a "cross-platform open-source C/C++ extension loading library" (from its website), while freeglut is a window manager that replaces the default OpenGL Utility Toolkit (GLUT) library.

So, as you see, both different have different purposes. The point of using freeglut is that it's still maintained, while the default GLUT isn't, so if you want bug fixes and new features you should use it :)

Weathersby answered 25/3, 2013 at 11:50 Comment(4)
So basically, one could just decide to use freeglut by itself? Or glew by itself? Without either one. So either of these have all the required functionality that the other has, why include both? Again, I don't get it. Sorry if this sounds really thick, but I don't, & the fact that all examples I've seen include both or some similar variant doesn't help.Nathanaelnathanial
Hang on, so GLEW is C/C++ specific? Whereas, Glut/freeglut isn't? Does that mean someone running C# or .net or something that isn't C/C++ couldn't use GLEW, they'd have to use glut or something else?Nathanaelnathanial
You are not required to use GLEW because it's a version manager (it ensures you have the proper versions for your OS), but it's helpful. You can also remove freeglut if you want to use the default GLUT, but then you'll be using old software because it seems to be abandoned...Weathersby
AFAIK, GLUT comes by default with OpenGL libraries and it's a window manager. Freeglut is an alternative to GLUT, they both do the same but GLUT seems to be abandon, while freeglut is still developed (I think). For GLEW, yes, it's only for C/C++. If you want to use it with C#, you'll have to use something else. Hope this helps!Weathersby

© 2022 - 2024 — McMap. All rights reserved.