Trace wglSwapMultipleBuffers
authorJosé Fonseca <jfonseca@vmware.com>
Sat, 13 Feb 2010 11:51:49 +0000 (11:51 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 12 Nov 2010 18:47:59 +0000 (18:47 +0000)
opengl32.def
opengl32.py

index a9e174f..9e717a7 100644 (file)
@@ -364,7 +364,7 @@ EXPORTS
        wglShareLists
        wglSwapBuffers
        wglSwapLayerBuffers
-;      wglSwapMultipleBuffers
+       wglSwapMultipleBuffers
        wglUseFontBitmapsA
        wglUseFontBitmapsW
        wglUseFontOutlinesA
index 52ebc6b..c6bcb2e 100644 (file)
@@ -532,6 +532,11 @@ LAYERPLANEDESCRIPTOR = Struct("LAYERPLANEDESCRIPTOR", [
 ])
 LPLAYERPLANEDESCRIPTOR = Pointer(LAYERPLANEDESCRIPTOR)
 
+WGLSWAP = Struct("WGLSWAP", [
+   (HDC, "hdc"),
+    (UINT, "uiFlags"),
+])
+
 opengl32.functions += [
     DllFunction(BOOL, "wglCopyContext", [(HGLRC, "hglrcSrc"), (HGLRC, "hglrcDst"), (UINT, "mask")]),
     DllFunction(HGLRC, "wglCreateContext", [(HDC, "hdc")]),
@@ -556,18 +561,9 @@ opengl32.functions += [
     DllFunction(Int  , "wglGetLayerPaletteEntries", [(HDC, "hdc"), (Int, "iLayerPlane"), (Int, "iStart"), (Int, "cEntries"), (OutPointer(COLORREF), "pcr")]),
     DllFunction(BOOL , "wglRealizeLayerPalette", [(HDC, "hdc"), (Int, "iLayerPlane"), (BOOL, "bRealize")]),
     DllFunction(BOOL , "wglSwapLayerBuffers", [(HDC, "hdc"), (UINT, "fuPlanes")]),
+    DllFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Pointer(Const(WGLSWAP)), "ps")]),
 ]
 
-if False:
-    WGLSWAP = Struct("WGLSWAP", [
-        (HDC, "hdc"),
-        (UINT, "uiFlags"),
-    ])
-
-    opengl32.functions += [
-        DllFunction(DWORD, "wglSwapMultipleBuffers", [(UINT, "n"), (Pointer(Const(WGLSWAP)), "ps")]),
-    ]
-
 
 class WglGetProcAddressFunction(DllFunction):
 
@@ -1270,6 +1266,18 @@ if __name__ == '__main__':
     print
     print '#include "log.hpp"'
     print
+    print '#ifdef __MINGW32__'
+    print ''
+    print 'typedef struct _WGLSWAP'
+    print '{'
+    print '    HDC hdc;'
+    print '    UINT uiFlags;'
+    print '} WGLSWAP, *PWGLSWAP, FAR *LPWGLSWAP;'
+    print ''
+    print '#define WGL_SWAPMULTIPLE_MAX 16'
+    print ''
+    print '#endif'
+    print
     print 'extern "C" {'
     print
     wrap()