From a583c3ab476078332679f96d2ca7fe8aab4c8d2d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 13 Feb 2010 15:09:46 +0000 Subject: [PATCH] wgl: Implement wglSwapMultipleBuffers. --- src/gallium/state_trackers/wgl/opengl32.def | 2 +- .../state_trackers/wgl/opengl32.mingw.def | 2 +- src/gallium/state_trackers/wgl/stw_wgl.c | 13 +++++++++++++ src/gallium/state_trackers/wgl/stw_wgl.h | 16 ++++++++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/wgl/opengl32.def b/src/gallium/state_trackers/wgl/opengl32.def index 5daa6ddd413..01a29d0391d 100644 --- a/src/gallium/state_trackers/wgl/opengl32.def +++ b/src/gallium/state_trackers/wgl/opengl32.def @@ -362,7 +362,7 @@ EXPORTS wglShareLists wglSwapBuffers wglSwapLayerBuffers -; wglSwapMultipleBuffers + wglSwapMultipleBuffers wglUseFontBitmapsA wglUseFontBitmapsW wglUseFontOutlinesA diff --git a/src/gallium/state_trackers/wgl/opengl32.mingw.def b/src/gallium/state_trackers/wgl/opengl32.mingw.def index 6ebb31a6f1b..0bceee06979 100644 --- a/src/gallium/state_trackers/wgl/opengl32.mingw.def +++ b/src/gallium/state_trackers/wgl/opengl32.mingw.def @@ -362,7 +362,7 @@ EXPORTS wglShareLists = wglShareLists@8 wglSwapBuffers = wglSwapBuffers@4 wglSwapLayerBuffers = wglSwapLayerBuffers@8 -; wglSwapMultipleBuffers = wglSwapMultipleBuffers@8 + wglSwapMultipleBuffers = wglSwapMultipleBuffers@8 wglUseFontBitmapsA = wglUseFontBitmapsA@16 wglUseFontBitmapsW = wglUseFontBitmapsW@16 wglUseFontOutlinesA = wglUseFontOutlinesA@32 diff --git a/src/gallium/state_trackers/wgl/stw_wgl.c b/src/gallium/state_trackers/wgl/stw_wgl.c index bb199fdd252..5fbb7bf7cfd 100644 --- a/src/gallium/state_trackers/wgl/stw_wgl.c +++ b/src/gallium/state_trackers/wgl/stw_wgl.c @@ -97,6 +97,19 @@ wglSwapBuffers( } +WINGDIAPI DWORD WINAPI +wglSwapMultipleBuffers(UINT n, + CONST WGLSWAP *ps) +{ + UINT i; + + for (i =0; i < n; ++i) + wglSwapBuffers(ps->hdc); + + return 0; +} + + WINGDIAPI BOOL APIENTRY wglSwapLayerBuffers( HDC hdc, diff --git a/src/gallium/state_trackers/wgl/stw_wgl.h b/src/gallium/state_trackers/wgl/stw_wgl.h index a98179944aa..57baaf0a11f 100644 --- a/src/gallium/state_trackers/wgl/stw_wgl.h +++ b/src/gallium/state_trackers/wgl/stw_wgl.h @@ -59,5 +59,21 @@ wglSetPixelFormat(HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd); +#if defined(__MINGW32__) || (WINVER < 0x0500) + +typedef struct _WGLSWAP +{ + HDC hdc; + UINT uiFlags; +} WGLSWAP; + +#define WGL_SWAPMULTIPLE_MAX 16 + +WINGDIAPI DWORD WINAPI +wglSwapMultipleBuffers(UINT n, + CONST WGLSWAP *ps); + +#endif + #endif /* STW_WGL_H_ */ -- 2.30.2