Hooks aren't present during replay, instead use funcptrs fetched at init

This commit is contained in:
baldurk
2017-02-23 12:22:02 +00:00
parent f694e28dca
commit 57f11ca568
+10 -3
View File
@@ -305,8 +305,13 @@
Threading::CriticalSection glLock;
typedef BOOL(WINAPI *WGLMAKECURRENTPROC)(HDC, HGLRC);
typedef BOOL(WINAPI *WGLDELETECONTEXTPROC)(HGLRC);
extern PFNWGLCREATECONTEXTATTRIBSARBPROC createContextAttribs;
extern PFNWGLGETPIXELFORMATATTRIBIVARBPROC getPixelFormatAttrib;
extern WGLMAKECURRENTPROC wglMakeCurrentProc;
extern WGLDELETECONTEXTPROC wglDeleteRC;
class OpenGLHook : LibraryHook, public GLPlatform
{
@@ -361,6 +366,8 @@ public:
{
if(wglMakeCurrent_hook())
wglMakeCurrent_hook()(data.DC, data.ctx);
else if(wglMakeCurrentProc)
wglMakeCurrentProc(data.DC, data.ctx);
}
GLWindowingData MakeContext(GLWindowingData share)
@@ -396,10 +403,10 @@ public:
void DeleteReplayContext(GLWindowingData context)
{
if(wglDeleteContext_hook())
if(wglDeleteRC)
{
wglMakeCurrent_hook()(NULL, NULL);
wglDeleteContext_hook()(context.ctx);
wglMakeCurrentProc(NULL, NULL);
wglDeleteRC(context.ctx);
ReleaseDC(context.wnd, context.DC);
::DestroyWindow(context.wnd);
}