-
Notifications
You must be signed in to change notification settings - Fork 625
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
Add custom get proc support #343
base: master
Are you sure you want to change the base?
Conversation
251ee76
to
0268962
Compare
There is a build failure in GLEW_STATIC mode:
|
0268962
to
414966c
Compare
I can understand the motivation and practicality of this proposed change. I'm not decided if GLEW can reasonably accommodate this sort of change, but I will give it some consideration and engagement. The additional wglew complexity is also a bit daunting from a maintainer perspective. |
auto/src/glew_head.c
Outdated
#if defined(GLEW_REGAL) | ||
#if defined(GLEW_CUSTOM_GET_PROC) | ||
# ifndef GLEW_STATIC | ||
# error GLEW_CUSTOM_GET_PROC currently requires GLEW_STATIC and defining the symbol GLEW_customGetProcAddress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps glewGetProcAddress
just ought to be used as-is, if already defined to something.
(A thought, not a firm opinion)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sounds reasonable (or did you mean use glewGetProcAddress as macro directly) :D
414966c
to
9b9e668
Compare
9b9e668
to
3ee0ae8
Compare
I load |
I'd say it is defenitely less useful, as atleast Linux uses mesa anyway and mesa supports |
Motvation:
OpenGL isn't really well supported under windows (e.g. borderless fullscreen causes weird black flushes, or doesn't really load the taskbar correctly and stuff like that)
So in order to let the user decide if they need borderless fullscreen over "real" fullscreen, we want to support glondirect12 mesa drivers.
They are, as of jan. 2022, slower than the native OpenGL drivers. So we want to have support for both.
Since GCC for windows doesn't support tricks like lazy dll loading, the easiest is to not being required to link OpenGL and add custom handlers for that.
SDL2 comes with
SDL_GL_LoadLibrary
which makes it easy to select a different opengl driver.Minimal code example:
e.g. by having mesa's opengl32.dll in a directory called "mesa" and all other required libs(for mesa opengl driver) where the working directory is(the .exe)
Important:
This moves GL 1.1 functions into GLEWs loading mecanism, even on windows. I dunno if this can potentially break something, or what the exact reason was, this wasnt done before.
This probably only works with glewContextInit, because there were code paths that used
wglGetCurrentDC
. Maybe this can be improved for easier usageCurrently it requires
GLEW_STATIC
for the custom symbolHere is the patch on DDNet, where we want to use it
(ddnet/ddnet#4600)