Commit 66a5995e authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Move wglGetCurrentContext and wglGetCurrentDC to the internal OpenGL extension functions.

parent 08efea02
......@@ -50,9 +50,7 @@ static struct
PROC (WINAPI *p_wglGetProcAddress)(LPCSTR lpszProc);
BOOL (WINAPI *p_SetPixelFormat)(HDC hdc, INT iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd);
BOOL (WINAPI *p_wglMakeCurrent)(HDC hdc, HGLRC hglrc);
HDC (WINAPI *p_wglGetCurrentDC)(void);
HGLRC (WINAPI *p_wglCreateContext)(HDC hdc);
HGLRC (WINAPI *p_wglGetCurrentContext)(void);
INT (WINAPI *p_ChoosePixelFormat)(HDC hdc, const PIXELFORMATDESCRIPTOR* ppfd);
INT (WINAPI *p_DescribePixelFormat)(HDC hdc, INT iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
INT (WINAPI *p_GetPixelFormat)(HDC hdc);
......@@ -60,9 +58,11 @@ static struct
/* internal WGL functions */
BOOL (WINAPI *p_wglCopyContext)(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask);
BOOL (WINAPI *p_wglDeleteContext)(HGLRC hglrc);
void (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
void (WINAPI *p_wglFinish)(void);
void (WINAPI *p_wglFlush)(void);
HGLRC (WINAPI *p_wglGetCurrentContext)(void);
HDC (WINAPI *p_wglGetCurrentDC)(void);
void (WINAPI *p_wglGetIntegerv)(GLenum pname, GLint* params);
BOOL (WINAPI *p_wglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
} wine_wgl;
......@@ -932,9 +932,7 @@ static BOOL process_attach(void)
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod_gdi32, "wglGetProcAddress");
wine_wgl.p_SetPixelFormat = (void *)GetProcAddress(mod_gdi32, "SetPixelFormat");
wine_wgl.p_wglMakeCurrent = (void *)GetProcAddress(mod_gdi32, "wglMakeCurrent");
wine_wgl.p_wglGetCurrentDC = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentDC");
wine_wgl.p_wglCreateContext = (void *)GetProcAddress(mod_gdi32, "wglCreateContext");
wine_wgl.p_wglGetCurrentContext = (void *)GetProcAddress(mod_gdi32, "wglGetCurrentContext");
wine_wgl.p_ChoosePixelFormat = (void *)GetProcAddress(mod_gdi32, "ChoosePixelFormat");
wine_wgl.p_DescribePixelFormat = (void *)GetProcAddress(mod_gdi32, "DescribePixelFormat");
wine_wgl.p_GetPixelFormat = (void *)GetProcAddress(mod_gdi32, "GetPixelFormat");
......@@ -942,9 +940,11 @@ static BOOL process_attach(void)
/* internal WGL functions */
wine_wgl.p_wglCopyContext = (void *)wine_wgl.p_wglGetProcAddress("wglCopyContext");
wine_wgl.p_wglDeleteContext = (void *)wine_wgl.p_wglGetProcAddress("wglDeleteContext");
wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");
wine_wgl.p_wglFinish = (void *)wine_wgl.p_wglGetProcAddress("wglFinish");
wine_wgl.p_wglFlush = (void *)wine_wgl.p_wglGetProcAddress("wglFlush");
wine_wgl.p_wglGetCurrentContext = (void *)wine_wgl.p_wglGetProcAddress("wglGetCurrentContext");
wine_wgl.p_wglGetCurrentDC = (void *)wine_wgl.p_wglGetProcAddress("wglGetCurrentDC");
wine_wgl.p_wglGetIntegerv = (void *)wine_wgl.p_wglGetProcAddress("wglGetIntegerv");
wine_wgl.p_wglShareLists = (void *)wine_wgl.p_wglGetProcAddress("wglShareLists");
if (!RegOpenKeyA( HKEY_CURRENT_USER, "Software\\Wine\\OpenGL", &hkey)) {
......
......@@ -5360,11 +5360,15 @@ static BOOL InitAdapters(struct wined3d *wined3d)
wglFinish = (void*)GetProcAddress(mod_gl, "glFinish");
wglFlush = (void*)GetProcAddress(mod_gl, "glFlush");
pwglDeleteContext = (void*)GetProcAddress(mod_gl, "wglDeleteContext");
pwglGetCurrentContext = (void*)GetProcAddress(mod_gl, "wglGetCurrentContext");
pwglGetCurrentDC = (void*)GetProcAddress(mod_gl, "wglGetCurrentDC");
pwglShareLists = (void*)GetProcAddress(mod_gl, "wglShareLists");
#else
wglFinish = (void*)pwglGetProcAddress("wglFinish");
wglFlush = (void*)pwglGetProcAddress("wglFlush");
pwglDeleteContext = (void*)pwglGetProcAddress("wglDeleteContext");
pwglGetCurrentContext = (void*)pwglGetProcAddress("wglGetCurrentContext");
pwglGetCurrentDC = (void*)pwglGetProcAddress("wglGetCurrentDC");
pwglShareLists = (void*)pwglGetProcAddress("wglShareLists");
#endif
......
......@@ -1713,8 +1713,6 @@ BOOL (WINAPI *pwglShareLists)(HGLRC, HGLRC) DECLSPEC_HIDDEN;
#define WGL_FUNCS_GEN \
USE_WGL_FUNC(wglCreateContext) \
USE_WGL_FUNC(wglGetCurrentContext) \
USE_WGL_FUNC(wglGetCurrentDC) \
USE_WGL_FUNC(wglGetProcAddress) \
USE_WGL_FUNC(wglMakeCurrent)
......
......@@ -2005,6 +2005,26 @@ static BOOL WINAPI X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2)
return FALSE;
}
/***********************************************************************
* X11DRV_wglGetCurrentContext
*/
static HGLRC WINAPI X11DRV_wglGetCurrentContext(void)
{
return NtCurrentTeb()->glContext;
}
/***********************************************************************
* X11DRV_wglGetCurrentDC
*/
static HDC WINAPI X11DRV_wglGetCurrentDC(void)
{
Wine_GLContext *ctx = NtCurrentTeb()->glContext;
if (!ctx) return NULL;
TRACE("hdc %p\n", ctx->hdc);
return ctx->hdc;
}
/* WGL helper function which handles differences in glGetIntegerv from WGL and GLX */
static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params)
{
......@@ -3251,9 +3271,11 @@ static const WineGLExtension WGL_internal_functions =
{
{ "wglCopyContext", X11DRV_wglCopyContext },
{ "wglDeleteContext", X11DRV_wglDeleteContext },
{ "wglGetIntegerv", X11DRV_wglGetIntegerv },
{ "wglFinish", X11DRV_wglFinish },
{ "wglFlush", X11DRV_wglFlush },
{ "wglGetCurrentContext", X11DRV_wglGetCurrentContext },
{ "wglGetCurrentDC", X11DRV_wglGetCurrentDC },
{ "wglGetIntegerv", X11DRV_wglGetIntegerv },
{ "wglShareLists", X11DRV_wglShareLists },
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment