summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-01-01 16:43:38 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-03-03 14:30:53 +0000
commite53568e2c5004a434a16e3971fb2cd0823e6487b (patch)
treee1c1185bc8b1f7abf08db221fb48e6f55d733096 /hw
parentdec5e9899bfee2a83f8a64f975790ecd2390256d (diff)
hw/xwin: Just generate the WGL wrappers we need
Just generate the WGL wrappers we need, rather than for everything in wgl.xml This avoids generating a lot of unused wrappers, and also avoids compilation requiring a wglext.h at least as new as wgl.xml Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw')
-rwxr-xr-xhw/xwin/glx/gen_gl_wrappers.py45
1 files changed, 14 insertions, 31 deletions
diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index 683b9d903..cdbba638a 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -43,35 +43,18 @@ thunkdefs=False
staticwrappers=False
nodebug=False
-#exclude base WGL API
-WinGDI={key: 1 for key in [
- "wglCopyContext"
- ,"wglCreateContext"
- ,"wglCreateLayerContext"
- ,"wglDeleteContext"
- ,"wglGetCurrentContext"
- ,"wglGetCurrentDC"
- ,"wglGetProcAddress"
- ,"wglMakeCurrent"
- ,"wglShareLists"
- ,"wglUseFontBitmapsA"
- ,"wglUseFontBitmapsW"
- ,"wglUseFontBitmaps"
- ,"SwapBuffers"
- ,"wglUseFontOutlinesA"
- ,"wglUseFontOutlinesW"
- ,"wglUseFontOutlines"
- ,"wglDescribeLayerPlane"
- ,"wglSetLayerPaletteEntries"
- ,"wglGetLayerPaletteEntries"
- ,"wglRealizeLayerPalette"
- ,"wglSwapLayerBuffers"
- ,"wglSwapMultipleBuffers"
- ,"ChoosePixelFormat"
- ,"DescribePixelFormat"
- ,"GetEnhMetaFilePixelFormat"
- ,"GetPixelFormat"
- ,"SetPixelFormat"
+# list of WGL extension functions we use
+used_wgl_ext_fns = {key: 1 for key in [
+ "wglSwapIntervalEXT",
+ "wglGetExtensionsStringARB",
+ "wglDestroyPbufferARB",
+ "wglGetPbufferDCARB",
+ "wglReleasePbufferDCARB",
+ "wglCreatePbufferARB",
+ "wglMakeContextCurrentARB",
+ "wglChoosePixelFormatARB",
+ "wglGetPixelFormatAttribivARB",
+ "wglGetPixelFormatAttribivARB"
]}
if __name__ == '__main__':
@@ -162,7 +145,7 @@ class PreResolveOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name):
OutputGenerator.genCmd(self, cmd, name)
- if name in WinGDI:
+ if prefix == 'wgl' and not name in used_wgl_ext_fns:
return
self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n')
@@ -190,7 +173,7 @@ class WrapperOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name):
OutputGenerator.genCmd(self, cmd, name)
- if name in WinGDI:
+ if prefix == 'wgl' and not name in used_wgl_ext_fns:
return
proto=noneStr(cmd.elem.find('proto'))