Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the deal with the GL3W.h header instead of GLEW.h #880

Closed
Moeman opened this issue Oct 21, 2016 · 6 comments
Closed

What's the deal with the GL3W.h header instead of GLEW.h #880

Moeman opened this issue Oct 21, 2016 · 6 comments
Labels

Comments

@Moeman
Copy link

Moeman commented Oct 21, 2016

I'm really confused about this. Are these the same libraries? The OpenGL tutorial I followed used GLEW instead of GL3W, and on the official OpenGL website GLEW is available in the libraries downloads.

imgui_impl_glfw.cpp crashes for me because I hadn't initialised GL3W, but I changed #include GL3W.h to #include GLEW.h and it works fine now. I'm not using an old version of OpenGL, it's relatively new, 3.2, and it's definitely not fixed function pipeline. I noticed in the OpenGL2 renderer example it just includes GLFW.

Thanks.

@skl131313
Copy link

It's just a OpenGL function loader, there isn't really anything special about it. GLEW has some problems with newer versions of GL and it can't correctly create a core profile. Creating GL contexts changed at some point and GLEW was never updated, as far as I know, or never correctly updated to match. Anyways it's just an example, you don't have to follow it. I use an OpenGL loader called GLAD, and it's worked for me so far.

@Tyran37
Copy link

Tyran37 commented Oct 26, 2016

Keep in mind gl3w loads core functions only if you decide to go with that.
You should probably read this if you want to know more about what these libraries are and the differences between them.
I personally recommend glad as well, it's lightweight and fully customizable to allow loading only what you really need.
Glew is still used in a lot of tutorials but has been getting less and less popular because of some long standing bugs, being very slow and not correctly supporting core contexts.

@ocornut
Copy link
Owner

ocornut commented Nov 12, 2016

OpenGL requiring those things is quite a unfortunate mess!
I'm just using GL3W for those example because it is simpler and smaller, but as mentioned you probably want to keep using whatever you are already using.

I will add commentary to the Examples to clarify that.

@ocornut
Copy link
Owner

ocornut commented Nov 12, 2016

Added those comments now. Thanks for the links. Glad looks quite better.

For those examples I like that gl3w has all its files in the same folder, whereas Glad spans multiple folders, and it's not really worth looking into a change seeing that examples/ are already a pain to maintain, but I'll keep it in mind.

@r-lyeh-archived
Copy link

@ocornut ocornut added the opengl label Jan 7, 2018
@stolk
Copy link

stolk commented Apr 6, 2021

I had an issue with using GL extensions when I used the imgui-provided gl3w. If you build your own version of gl3w, you can use the flag ./gl3w_gen.py --ext to get access to the extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants