From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 10 ++-- dlls/opengl32/private.h | 41 ++++++++++++++ dlls/opengl32/thunks.c | 5 +- .../opengl32/{opengl_ext.h => unix_private.h} | 53 ++++++++----------- dlls/opengl32/unix_thunks.c | 3 +- dlls/opengl32/unix_wgl.c | 3 +- dlls/opengl32/wgl.c | 12 ++--- 7 files changed, 78 insertions(+), 49 deletions(-) create mode 100644 dlls/opengl32/private.h rename dlls/opengl32/{opengl_ext.h => unix_private.h} (60%)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 78368ec6c2f..79b10955f95 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -871,8 +871,8 @@ print OUT "#include "windef.h"\n"; print OUT "#include "winbase.h"\n"; print OUT "#include "wingdi.h"\n\n";
-print OUT "#include "unixlib.h"\n\n"; -print OUT "#include "opengl_ext.h"\n\n"; +print OUT "#include "unixlib.h"\n"; +print OUT "#include "private.h"\n\n"; print OUT "#include "wine/debug.h"\n\n"; print OUT "WINE_DEFAULT_DEBUG_CHANNEL(opengl);\n";
@@ -907,7 +907,7 @@ foreach (sort keys %ext_functions) # Then the table giving the string <-> function correspondence */ my $count = keys %ext_functions; print OUT "\nconst int extension_registry_size = $count;\n"; -print OUT "const OpenGL_extension extension_registry[$count] =\n"; +print OUT "const struct opengl_extension_desc extension_registry[$count] =\n"; print OUT "{\n"; foreach (sort keys %ext_functions) { @@ -933,8 +933,8 @@ print OUT "#include "windef.h"\n"; print OUT "#include "winbase.h"\n"; print OUT "#include "wingdi.h"\n\n";
-print OUT "#include "unixlib.h"\n\n"; -print OUT "#include "opengl_ext.h"\n\n"; +print OUT "#include "unixlib.h"\n"; +print OUT "#include "unix_private.h"\n\n";
foreach (sort keys %wgl_functions) { diff --git a/dlls/opengl32/private.h b/dlls/opengl32/private.h new file mode 100644 index 00000000000..e8cf32231f9 --- /dev/null +++ b/dlls/opengl32/private.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2000 Lionel Ulmer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_OPENGL32_PRIVATE_H +#define __WINE_OPENGL32_PRIVATE_H + +#include <stdarg.h> +#include <stddef.h> + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" + +struct opengl_extension_desc +{ + const char *name; /* name of the extension */ + const char *extension; /* name of the GL/WGL extension */ + void *func; /* pointer to the Wine function for this extension */ +}; + +extern const struct opengl_extension_desc extension_registry[] DECLSPEC_HIDDEN; +extern const int extension_registry_size DECLSPEC_HIDDEN; + +extern int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd ); + +#endif /* __WINE_OPENGL32_PRIVATE_H */ diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index a2a78bff97d..955168e2004 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -10,8 +10,7 @@ #include "wingdi.h"
#include "unixlib.h" - -#include "opengl_ext.h" +#include "private.h"
#include "wine/debug.h"
@@ -24466,7 +24465,7 @@ extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC extern HDC WINAPI wglGetCurrentReadDCARB(void) DECLSPEC_HIDDEN;
const int extension_registry_size = 2694; -const OpenGL_extension extension_registry[2694] = +const struct opengl_extension_desc extension_registry[2694] = { { "glAccumxOES", "GL_OES_fixed_point", glAccumxOES }, { "glAcquireKeyedMutexWin32EXT", "GL_EXT_win32_keyed_mutex", glAcquireKeyedMutexWin32EXT }, diff --git a/dlls/opengl32/opengl_ext.h b/dlls/opengl32/unix_private.h similarity index 60% rename from dlls/opengl32/opengl_ext.h rename to dlls/opengl32/unix_private.h index 2a579e142b6..0b365697b2b 100644 --- a/dlls/opengl32/opengl_ext.h +++ b/dlls/opengl32/unix_private.h @@ -1,27 +1,28 @@ -/* Typedefs for extensions loading - - Copyright (c) 2000 Lionel Ulmer -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -*/ -#ifndef __DLLS_OPENGL32_OPENGL_EXT_H -#define __DLLS_OPENGL32_OPENGL_EXT_H +/* + * Copyright (c) 2000 Lionel Ulmer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#ifndef __WINE_OPENGL32_UNIX_PRIVATE_H +#define __WINE_OPENGL32_UNIX_PRIVATE_H
#include <stdarg.h> #include <stddef.h>
+#include "ntstatus.h" +#define WIN32_NO_STATUS #include "windef.h" #include "winbase.h" #include "winternl.h" @@ -30,14 +31,6 @@ #include "wine/wgl.h" #include "wine/wgl_driver.h"
-typedef struct { - const char *name; /* name of the extension */ - const char *extension; /* name of the GL/WGL extension */ - void *func; /* pointer to the Wine function for this extension */ -} OpenGL_extension; - -extern const OpenGL_extension extension_registry[] DECLSPEC_HIDDEN; -extern const int extension_registry_size DECLSPEC_HIDDEN; extern struct opengl_funcs null_opengl_funcs DECLSPEC_HIDDEN;
static inline struct opengl_funcs *get_dc_funcs( HDC hdc ) @@ -99,6 +92,4 @@ static inline enum wgl_handle_type get_current_context_type(void) return LOWORD(NtCurrentTeb()->glCurrentRC) & HANDLE_TYPE_MASK; }
-extern int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd ); - -#endif /* __DLLS_OPENGL32_OPENGL_EXT_H */ +#endif /* __WINE_OPENGL32_UNIX_PRIVATE_H */ diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 86af754b278..84fe350ded8 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -10,8 +10,7 @@ #include "wingdi.h"
#include "unixlib.h" - -#include "opengl_ext.h" +#include "unix_private.h"
extern NTSTATUS wgl_wglCopyContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 75f879de93f..8aa07ac1da6 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -29,9 +29,8 @@ #include "winbase.h" #include "ntuser.h"
-#include "opengl_ext.h" - #include "unixlib.h" +#include "unix_private.h"
#include "wine/debug.h"
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index d5b0a78b916..f4ab29e0356 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -31,9 +31,9 @@ #include "winreg.h" #include "ntuser.h"
-#include "opengl_ext.h" - #include "unixlib.h" +#include "unix_private.h" +#include "private.h"
#include "wine/glu.h" #include "wine/debug.h" @@ -516,8 +516,8 @@ const GLubyte * WINAPI glGetStringi(GLenum name, GLuint index) }
static int compar(const void *elt_a, const void *elt_b) { - return strcmp(((const OpenGL_extension *) elt_a)->name, - ((const OpenGL_extension *) elt_b)->name); + return strcmp( ((const struct opengl_extension_desc *)elt_a)->name, + ((const struct opengl_extension_desc *)elt_b)->name ); }
/* Check if a GL extension is supported */ @@ -623,8 +623,8 @@ PROC WINAPI wglGetProcAddress( LPCSTR name ) { struct opengl_funcs *funcs = NtCurrentTeb()->glTable; void **func_ptr; - OpenGL_extension ext; - const OpenGL_extension *ext_ret; + struct opengl_extension_desc ext; + const struct opengl_extension_desc *ext_ret;
if (!name) return NULL;