Closed GoldenbergDaniel closed 1 month ago
I found that OpenGL loading was moved out of sokol_app, so just calling gladLoadGL worked well for me.
An external GL loader or GL headers are not needed on Windows both for sokol_app.h and sokol_gfx.h since both headers are coming with their own GL loaders which are enabled by default (but can be disabled).
What types of problems were you seeing?
PS: sokol_app.h itself only calls the glGetIntegerv() function, the rest are WGL functions. Those are initialized here:
...and the Windows GL loader in sokol_gfx.h is implemented here for the definitions:
...and the rest is here:
...ah I think I understand. You are probably using sokol_app.h with your own GL function calls (instead of sokol_gfx.h), and expect that sokol_app.h loads the GL headers for you. Yep, that's indeed not the case on Windows (since the Windows SDK doesn't have uptodate GL headers). You'll have to use a GL loader.
Here's an example where I'm doing somthing similar (call directly into GL functions). In that case I use flextGL as GL loader (and disable sokol_gfx.h's GL loader):
https://github.com/floooh/sokol-samples/blob/master/glfw/multiwindow-glfw.c
I'm not sure how to get OpenGL working with sokol_app on Windows. On macOS, all I need to do is include the GL header file provided by Apple and link against the OpenGL framework. But since windows only provides OpenGL 1.1 support, I assume I have to use a loader (to get them from the GPU driver). My idea is to use GLAD, but I can't find any function that returns the loader for gladLoadGLLoader to use. Any help would be much appreciated.