From 46bbcd678939323ac03acfd0b1f8f17f52cb2b6b Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 15 Jul 2022 13:49:23 +0200 Subject: [PATCH] wined3d: Don't use __wine_get_wgl_driver. --- dlls/wined3d/Makefile.in | 2 +- dlls/wined3d/adapter_gl.c | 18 ------------------ dlls/wined3d/wined3d_private.h | 6 ------ 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in index c7c87865405..23051f2a58b 100644 --- a/dlls/wined3d/Makefile.in +++ b/dlls/wined3d/Makefile.in @@ -1,7 +1,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES MODULE = wined3d.dll IMPORTLIB = wined3d -IMPORTS = $(VKD3D_PE_LIBS) dxguid opengl32 user32 gdi32 advapi32 win32u +IMPORTS = $(VKD3D_PE_LIBS) dxguid opengl32 user32 gdi32 advapi32 EXTRAINCL = $(VKD3D_PE_CFLAGS) C_SRCS = \ diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index d341668b808..60a168b5cef 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -2756,12 +2756,6 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) USE_GL_FUNC(glVertexAttribPointer) /* OpenGL 2.0 */ #undef USE_GL_FUNC -#ifndef USE_WIN32_OPENGL - /* hack: use the functions directly from the TEB table to bypass the thunks */ - /* note that we still need the above wglGetProcAddress calls to initialize the table */ - gl_info->gl_ops.ext = ((struct opengl_funcs *)NtCurrentTeb()->glTable)->ext; -#endif - #define MAP_GL_FUNCTION(core_func, ext_func) \ do \ { \ @@ -5312,7 +5306,6 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, return FALSE; /* Dynamically load all GL core functions */ -#ifdef USE_WIN32_OPENGL { HMODULE mod_gl = GetModuleHandleA("opengl32.dll"); #define USE_GL_FUNC(f) gl_info->gl_ops.gl.p_##f = (void *)GetProcAddress(mod_gl, #f); @@ -5321,17 +5314,6 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers"); gl_info->gl_ops.wgl.p_wglGetPixelFormat = (void *)GetProcAddress(mod_gl, "wglGetPixelFormat"); } -#else - /* To bypass the opengl32 thunks retrieve functions from the WGL driver instead of opengl32 */ - { - HDC hdc = GetDC( 0 ); - const struct opengl_funcs *wgl_driver = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION ); - ReleaseDC( 0, hdc ); - if (!wgl_driver || wgl_driver == (void *)-1) return FALSE; - gl_info->gl_ops.wgl = wgl_driver->wgl; - gl_info->gl_ops.gl = wgl_driver->gl; - } -#endif gl_info->p_glEnableWINE = gl_info->gl_ops.gl.p_glEnable; gl_info->p_glDisableWINE = gl_info->gl_ops.gl.p_glDisable; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 09ba3487616..4e0879a3985 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -25,13 +25,7 @@ #ifndef __WINE_WINED3D_PRIVATE_H #define __WINE_WINED3D_PRIVATE_H -#define USE_WIN32_OPENGL - -#ifdef USE_WIN32_OPENGL #define WINE_GLAPI __stdcall -#else -#define WINE_GLAPI -#endif #include #include