PDA

View Full Version : GLEW used in production quality products?



Ernesto23131
01-01-2015, 07:04 PM
I am a novice OpenGL coder and have only written basic programs in academia using SFML framework. I relied on GLEW a lot. But I looked at some of the threads in the OpenGL forum and a couple of people have pointed out some major flaws in GLEW. GLEW has served me fine and I understand what it does. It's good enough for the kind of simple and purely academic programs I have written. But I don't imagine professional studios rely on something simple like GLEW. Just curious, do the major OpenGL employers like game outfits use GLEW or do they wrangle the extensions themselves? Can I get some insight into what industry uses?

Apologies ahead of time if this is in the wrong section. Also I don't think this question has been asked before and I did my best to check that it hasn't been.

GClements
01-02-2015, 05:58 AM
The most recent OpenGL-based commercial game for which I've looked at the source code is Doom3 (https://github.com/TTimo/doom3.gpl/) which has explicitly queries extensions and function pointers. Link (https://github.com/TTimo/doom3.gpl/blob/master/neo/renderer/RenderSystem_init.cpp#L334).

But that was 10 years ago, when GLEW was significantly less mature. I have no idea whether they'd take the same approach now.

Alfonse Reinheart
01-02-2015, 11:05 AM
I'm not sure you can call GLEW "mature", when it requires something it explicitly calls "experimental" just to work in a core OpenGL context. And this is over six years after OpenGL 3.1 came out. ;)

dorbie
01-05-2015, 06:24 AM
The question is can you do something better and more mature. I suspect the answer is no. GLEW saves you a lot of effort, works and solves a lot of cross platform and compatibility headaches. It is useful in a professional application. It is JUST a thin API binding layer to map queried or included function entry points to a consistent API.

mhagain
01-05-2015, 09:48 AM
The thing is that GLEW is set up as a "one-size-fits-all" extension and function pointer grabber. Aside from the GLEW_EXPERIMENTAL thing (which if you look at the header file will tell you that it allows GLEW to grab function pointers even if an extension is absent from the GL_EXTENSIONS string) it's designed for pretty much the lowest common denominator use cases.

Sometimes that's exactly what you need, but sometimes it's not. For example, from looking over the Doom 3 source code we can see that they've added their own GL logging and swap function pointers around between a logging version and the standard version depending on whether or not logging is enabled. GLEW doesn't have that capability, so therefore they didn't use it (that's not saying it's the only reason they didn't use it, of course, but it is one reason).