wgl: Move wglGetCurrentContext to gdi32.

oldstable
Roderick Colenbrander 2006-10-14 12:56:07 +02:00 committed by Alexandre Julliard
parent ef998ea6cb
commit ad7bc71c0c
6 changed files with 17 additions and 36 deletions

View File

@ -499,6 +499,7 @@
# Wine extensions: OpenGL support
#
@ stdcall wglCreateContext(long)
@ stdcall wglGetCurrentContext()
@ stdcall wglMakeCurrent(long long)
@ stdcall wglUseFontBitmapsA(long long long long)
@ stdcall wglUseFontBitmapsW(long long long long)

View File

@ -31,6 +31,8 @@
#include "winbase.h"
#include "wingdi.h"
#include "winerror.h"
#include "winternl.h"
#include "winnt.h"
#include "gdi.h"
#include "gdi_private.h"
#include "wine/debug.h"
@ -72,6 +74,16 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
return ret;
}
/***********************************************************************
* wglGetCurrentContext (OPENGL32.@)
*/
HGLRC WINAPI wglGetCurrentContext(void)
{
HGLRC ret = NtCurrentTeb()->glContext;
TRACE(" returning %p\n", ret);
return ret;
}
/***********************************************************************
* wglMakeCurrent (OPENGL32.@)
*/

View File

@ -381,7 +381,7 @@
@ stdcall wglDeleteContext(long)
@ stdcall wglDescribeLayerPlane(long long long long ptr)
@ stdcall wglDescribePixelFormat(long long long ptr) gdi32.DescribePixelFormat
@ stdcall wglGetCurrentContext()
@ stdcall wglGetCurrentContext() gdi32.wglGetCurrentContext
@ stdcall wglGetCurrentDC()
@ stub wglGetDefaultProcAddress
@ stdcall wglGetLayerPaletteEntries(long long long long ptr)

View File

@ -48,7 +48,6 @@ WINE_DECLARE_DEBUG_CHANNEL(opengl);
typedef struct wine_wgl_s {
BOOL WINAPI (*p_wglDeleteContext)(HGLRC hglrc);
HGLRC WINAPI (*p_wglGetCurrentContext)(void);
HDC WINAPI (*p_wglGetCurrentDC)(void);
PROC WINAPI (*p_wglGetProcAddress)(LPCSTR lpszProc);
BOOL WINAPI (*p_wglShareLists)(HGLRC hglrc1, HGLRC hglrc2);
@ -172,14 +171,6 @@ BOOL WINAPI wglDescribeLayerPlane(HDC hdc,
return FALSE;
}
/***********************************************************************
* wglGetCurrentContext (OPENGL32.@)
*/
HGLRC WINAPI wglGetCurrentContext(void) {
TRACE("\n");
return wine_wgl.p_wglGetCurrentContext();
}
/***********************************************************************
* wglGetCurrentDC (OPENGL32.@)
*/
@ -650,7 +641,6 @@ static BOOL process_attach(void)
/* Load WGL function pointers from winex11.drv */
wine_wgl.p_wglDeleteContext = (void *)GetProcAddress(mod, "wglDeleteContext");
wine_wgl.p_wglGetCurrentContext = (void *)GetProcAddress(mod, "wglGetCurrentContext");
wine_wgl.p_wglGetCurrentDC = (void *)GetProcAddress(mod, "wglGetCurrentDC");
wine_wgl.p_wglGetProcAddress = (void *)GetProcAddress(mod, "wglGetProcAddress");
wine_wgl.p_wglShareLists = (void *)GetProcAddress(mod, "wglShareLists");

View File

@ -1272,23 +1272,6 @@ BOOL WINAPI X11DRV_wglDeleteContext(HGLRC hglrc)
return ret;
}
/* OpenGL32 wglGetCurrentContext() */
HGLRC WINAPI X11DRV_wglGetCurrentContext(void) {
GLXContext gl_ctx;
Wine_GLContext *ret;
TRACE("()\n");
wine_tsx11_lock();
gl_ctx = pglXGetCurrentContext();
ret = get_context_from_GLXContext(gl_ctx);
wine_tsx11_unlock();
TRACE(" returning %p (GL context %p)\n", ret, gl_ctx);
return (HGLRC)ret;
}
/* OpenGL32 wglGetCurrentDC */
HDC WINAPI X11DRV_wglGetCurrentDC(void) {
GLXContext gl_ctx;
@ -1417,6 +1400,7 @@ static BOOL WINAPI X11DRV_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGL
wine_tsx11_lock();
if (hglrc == NULL) {
ret = pglXMakeCurrent(gdi_display, None, NULL);
NtCurrentTeb()->glContext = NULL;
} else {
if (NULL == pglXMakeContextCurrent) {
ret = FALSE;
@ -1430,6 +1414,7 @@ static BOOL WINAPI X11DRV_wglMakeContextCurrentARB(HDC hDrawDC, HDC hReadDC, HGL
TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
}
ret = pglXMakeContextCurrent(ctx->display, d_draw, d_read, ctx->ctx);
NtCurrentTeb()->glContext = ctx;
}
}
wine_tsx11_unlock();
@ -2369,7 +2354,7 @@ static GLboolean WINAPI X11DRV_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuf
do_init = 1;
}
object->prev_hdc = X11DRV_wglGetCurrentDC();
object->prev_ctx = X11DRV_wglGetCurrentContext();
object->prev_ctx = wglGetCurrentContext();
/* FIXME: This is routed through gdi32.dll to winex11.drv, replace this with GLX calls */
wglMakeCurrent(object->render_hdc, object->render_ctx);
/*
@ -2799,12 +2784,6 @@ BOOL WINAPI X11DRV_wglDeleteContext(HGLRC hglrc) {
return FALSE;
}
/* OpenGL32 wglGetCurrentContext() */
HGLRC WINAPI X11DRV_wglGetCurrentContext(void) {
ERR_(opengl)("No OpenGL support compiled in.\n");
return NULL;
}
/* OpenGL32 wglGetCurrentDC */
HDC WINAPI X11DRV_wglGetCurrentDC(void) {
ERR_(opengl)("No OpenGL support compiled in.\n");

View File

@ -131,7 +131,6 @@
# OpenGL
@ cdecl wglCreateContext(long) X11DRV_wglCreateContext
@ cdecl wglDeleteContext(long) X11DRV_wglDeleteContext
@ cdecl wglGetCurrentContext() X11DRV_wglGetCurrentContext
@ cdecl wglGetCurrentDC() X11DRV_wglGetCurrentDC
@ cdecl wglGetIntegerv(long ptr) X11DRV_wglGetIntegerv
@ cdecl wglGetProcAddress(ptr) X11DRV_wglGetProcAddress