wglSwapMultipleBuffers --- an undocumented wgl api
http://tech.groups.yahoo.com/group/opengl-gamedev-l/message/15020
RE: undocumented opengl function headers
wglSwapMultipleBuffer would allow to swap more than
one window at one time. For example if
you have four views like in a CAD application,
if you call wglSwapBuffer in sequence for each
of them there is a small delay because it's
a blocking call. It's annoying during playback
of animation, because the contexts can
be seen to swaping clockwise, for example (though
it can be minimized). It's probably not implemented,
like the DirectDraw flag (good intension only).
The layer API already allows multiple layers in
a single call.
我尝试使用单线程创建的rendercontext所关联的一组hdc,同时调用wglSwapMultipleBuffers,不管哪一个被MakeCurrent,都可以通过调用这个api来同时翻转两个窗口;
已经具备了d3d swap chain的能力了。不过os版本需要0x500支持,意味着win9x系列不能直接支持此API(也许可以GetProcess?没有试过);并且每次支持最多16个同时翻屏。
WGLSWAP.uiFlags设置为!0,就可以翻转了。
//wingdi.h
#if (WINVER >= 0x0500)
typedef struct _WGLSWAP
{
HDC hdc;
UINT uiFlags;
} WGLSWAP, *PWGLSWAP, FAR *LPWGLSWAP;
#define WGL_SWAPMULTIPLE_MAX 16
WINGDIAPI DWORD WINAPI wglSwapMultipleBuffers(UINT, CONST WGLSWAP *);
#endif // (WINVER >= 0x0500)