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

Closed
opened 2016-10-21 03:26:41 +00:00 by Moeman · 6 comments
Moeman commented 2016-10-21 03:26:41 +00:00 (Migrated from github.com)

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.

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 commented 2016-10-24 22:41:34 +00:00 (Migrated from github.com)

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.

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 commented 2016-10-26 21:55:12 +00:00 (Migrated from github.com)

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.

Keep in mind gl3w loads core functions only if you decide to go with that. You should probably read [this](https://www.opengl.org/wiki/OpenGL_Loading_Library) 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 commented 2016-11-12 11:40:29 +00:00 (Migrated from github.com)

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.

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 commented 2016-11-12 11:51:59 +00:00 (Migrated from github.com)

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.

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 commented 2016-11-15 13:10:43 +00:00 (Migrated from github.com)
FYI :) https://github.com/gingerBill/gl3w-Single-File
stolk commented 2021-04-06 19:43:43 +00:00 (Migrated from github.com)

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.

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 in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#880
No description provided.