From 2d03463e23737c9a9471688b02c7846b8a43cf59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 13 Feb 2010 11:51:49 +0000 Subject: [PATCH] Trace wglSwapMultipleBuffers --- opengl32.def | 2 +- opengl32.py | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/opengl32.def b/opengl32.def index a9e174f..9e717a7 100644 --- a/opengl32.def +++ b/opengl32.def @@ -364,7 +364,7 @@ EXPORTS wglShareLists wglSwapBuffers wglSwapLayerBuffers -; wglSwapMultipleBuffers + wglSwapMultipleBuffers wglUseFontBitmapsA wglUseFontBitmapsW wglUseFontOutlinesA diff --git a/opengl32.py b/opengl32.py index 52ebc6b..c6bcb2e 100644 --- a/opengl32.py +++ b/opengl32.py @@ -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() -- 2.45.2