summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-17 10:17:17 -0800
committerEric Anholt <eric@anholt.net>2013-12-17 12:11:05 -0800
commit417927e2ebea79f52f65e63e2524c01a351960ee (patch)
tree8c15b653f523f66ec83ff3e262794164d4826d65
parent9a7be0784faba0d97a32051a873d7feb47981a37 (diff)
win32: Start wrapping the 1.0 wgl functions.
I want to have a chance to intercept wglMakeCurrent for WGL's context-dependent function pointer handling.
-rwxr-xr-xsrc/gen_dispatch.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index 35c74de..ce3f948 100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
@@ -306,14 +306,18 @@ class Generator(object):
def process_require_statements(self, feature, condition, loader, human_name):
for command in feature.findall('require/command'):
name = command.get('name')
+
+ # wgl.xml describes 6 functions in WGL 1.0 that are in
+ # gdi32.dll instead of opengl32.dll, and we would need to
+ # change up our symbol loading to support that. Just
+ # don't wrap those functions.
+ if self.target == 'wgl' and 'wgl' not in name:
+ del self.functions[name]
+ continue;
+
func = self.functions[name]
func.add_provider(condition, loader, human_name)
- def delete_require_statements(self, feature):
- for command in feature.findall('require/command'):
- name = command.get('name')
- del self.functions[name]
-
def parse_function_providers(self, reg):
for feature in reg.findall('feature'):
api = feature.get('api') # string gl, gles1, gles2, glx
@@ -362,14 +366,9 @@ class Generator(object):
# eglGetProcAdddress() will return NULL.
loader = 'epoxy_egl_dlsym({0})'
elif api == 'wgl':
- # There's no reason for us to interpose the
- # non-extension WGL symbols, which we know are always
- # available. The registry lists WGL 1.0 symbols both
- # from opengl32.dll and gdi32.dll, so our dlsym()
- # would have to know which came from where, if we were
- # to interpose.
- self.delete_require_statements(feature)
- continue
+ human_name = 'WGL {0}'.format(version)
+ condition = 'true'
+ loader = 'epoxy_gl_dlsym({0})'
else:
sys.exit('unknown API: "{0}"'.format(api))