Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.48k stars 418 forks source link

Where is GLEW? #11

Closed mottosso closed 9 years ago

mottosso commented 9 years ago

As a complete beginner to OpenGL, I'm wondering why GLEW was left out of Glitter, especially since both tutorials linked to* assume to use it?

* Specifically, these.

metiulekm commented 9 years ago

As far as I know @Polytonic used glad instead, which is a library with a similar function.

mottosso commented 9 years ago

Thanks @metiulekm, any idea why glad got chosen in favour of GLEW?

metiulekm commented 9 years ago

I don't really know, let's wait and see what @Polytonic says. The only thing I know is that GLEW is said by some people to be kinda outdated, but I don't know if this is the real reason.

Polytonic commented 9 years ago

@mottosso @metiulekm glad is header-only. Pretty much the only reason. I couldn't get GLEW and CMake to play nicely together. That being said, if I had the choice of any OpenGL function loader, I would use glbinding anyway, not GLEW. Having to pass glewExperimental = true is absolutely criminal considering it's 2015.

metiulekm commented 9 years ago

Oh. I didn't even see that. Well, header-only libs are always easier to use... And glbinding looks useful too.

Polytonic commented 9 years ago

One problem with glbinding is that it enforces types a little too rigidly, so you end up having to do crazy stuff like static_cast<bool>(GL_TRUE) to go from their enum representation to the underlying type that OpenGL expects. It adds a lot of extra code to read, but that's the price you pay for type safety ...

Polytonic commented 9 years ago

@mottosso just want to follow up on this. Does this answer your question?

Would it help if I added a note re: GLEW in the main readme?

mottosso commented 9 years ago

@Polytonic Yes it does, thanks for that! And yes, a small note I think would help others walking the same path as me, I actually went through compiling and installing GLEW alongside glad as I didn't understand that it was supposed to substitute it.

Polytonic commented 9 years ago

@mottosso I pushed a small update. Let me know if this is more informative! :smile:

mottosso commented 9 years ago

Looks good to me, thanks. :)

Polytonic commented 9 years ago

@mottosso @metiulekm glad is header-only. Pretty much the only reason. I couldn't get GLEW and CMake to play nicely together. That being said, if I had the choice of any OpenGL function loader, I would use glbinding anyway, not GLEW. Having to pass glewExperimental = true is absolutely criminal considering it's 2015.

@metiulekm sorry, I don't know why I said glad was header-only. I meant to say "the header and source are standalone" and didn't require me to invoke GNU make or CMake to build/link with.

metiulekm commented 9 years ago

Ok :smiley: