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>
This commit is contained in:
Jon TURNEY 2014-01-01 16:43:38 +00:00
parent dec5e9899b
commit e53568e2c5

View File

@ -43,35 +43,18 @@ thunkdefs=False
staticwrappers=False staticwrappers=False
nodebug=False nodebug=False
#exclude base WGL API # list of WGL extension functions we use
WinGDI={key: 1 for key in [ used_wgl_ext_fns = {key: 1 for key in [
"wglCopyContext" "wglSwapIntervalEXT",
,"wglCreateContext" "wglGetExtensionsStringARB",
,"wglCreateLayerContext" "wglDestroyPbufferARB",
,"wglDeleteContext" "wglGetPbufferDCARB",
,"wglGetCurrentContext" "wglReleasePbufferDCARB",
,"wglGetCurrentDC" "wglCreatePbufferARB",
,"wglGetProcAddress" "wglMakeContextCurrentARB",
,"wglMakeCurrent" "wglChoosePixelFormatARB",
,"wglShareLists" "wglGetPixelFormatAttribivARB",
,"wglUseFontBitmapsA" "wglGetPixelFormatAttribivARB"
,"wglUseFontBitmapsW"
,"wglUseFontBitmaps"
,"SwapBuffers"
,"wglUseFontOutlinesA"
,"wglUseFontOutlinesW"
,"wglUseFontOutlines"
,"wglDescribeLayerPlane"
,"wglSetLayerPaletteEntries"
,"wglGetLayerPaletteEntries"
,"wglRealizeLayerPalette"
,"wglSwapLayerBuffers"
,"wglSwapMultipleBuffers"
,"ChoosePixelFormat"
,"DescribePixelFormat"
,"GetEnhMetaFilePixelFormat"
,"GetPixelFormat"
,"SetPixelFormat"
]} ]}
if __name__ == '__main__': if __name__ == '__main__':
@ -162,7 +145,7 @@ class PreResolveOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name): def genCmd(self, cmd, name):
OutputGenerator.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 return
self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n') self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n')
@ -190,7 +173,7 @@ class WrapperOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name): def genCmd(self, cmd, name):
OutputGenerator.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 return
proto=noneStr(cmd.elem.find('proto')) proto=noneStr(cmd.elem.find('proto'))