diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 9ca5ebd530e..2b15f58dad7 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -236,6 +236,7 @@ sub GenerateThunk($$$$) my $trace_arg = ""; return "" if $name eq "glDebugEntry"; + return "" if $name eq "glGetIntegerv"; return "" if $name eq "glGetString"; return "" if $func_ref->[2] && $func_ref->[2]->[0] =~ /WGL_/; @@ -285,6 +286,7 @@ sub GenerateThunk($$$$) } } $ret .= 'void ' if (!@{$func_ref->[1]}); + return "$ret) DECLSPEC_HIDDEN;\n" if $name eq "glGetStringi"; $ret .= ") {\n"; $ret .= " const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n"; if ($func_ref->[0] ne "void" && $gen_thread_safe) { @@ -951,7 +953,11 @@ my $count = keys %ext_functions; print EXT "const int extension_registry_size = $count;\n"; foreach (sort keys %ext_functions) { my $string = GenerateThunk($_, $ext_functions{$_}, 0, "ext"); - print EXT "\nstatic $string" if $string; + if ($string =~ /DECLSPEC_HIDDEN/) { + print EXT "\n$string"; + } else { + print EXT "\nstatic $string" if $string; + } } # Then the table giving the string <-> function correspondence */ diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c index 9b9dfa7c116..67ebc591167 100644 --- a/dlls/opengl32/opengl_ext.c +++ b/dlls/opengl32/opengl_ext.c @@ -5014,11 +5014,7 @@ static void WINAPI glGetSharpenTexFuncSGIS( GLenum target, GLfloat* points ) { funcs->ext.p_glGetSharpenTexFuncSGIS( target, points ); } -static const GLubyte* WINAPI glGetStringi( GLenum name, GLuint index ) { - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - TRACE("(%d, %d)\n", name, index ); - return funcs->ext.p_glGetStringi( name, index ); -} +const GLubyte* WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN; static GLuint WINAPI glGetSubroutineIndex( GLuint program, GLenum shadertype, const GLchar* name ) { const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; diff --git a/dlls/opengl32/opengl_norm.c b/dlls/opengl32/opengl_norm.c index 52fb00ba60c..34a48927cf0 100644 --- a/dlls/opengl32/opengl_norm.c +++ b/dlls/opengl32/opengl_norm.c @@ -947,15 +947,6 @@ void WINAPI glGetFloatv( GLenum pname, GLfloat* data ) { funcs->gl.p_glGetFloatv( pname, data ); } -/*********************************************************************** - * glGetIntegerv (OPENGL32.@) - */ -void WINAPI glGetIntegerv( GLenum pname, GLint* data ) { - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - TRACE("(%d, %p)\n", pname, data ); - funcs->gl.p_glGetIntegerv( pname, data ); -} - /*********************************************************************** * glGetLightfv (OPENGL32.@) */ diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 6ff54f0dfb0..b028fe00663 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -687,27 +687,42 @@ int WINAPI wglGetLayerPaletteEntries(HDC hdc, return 0; } +void WINAPI glGetIntegerv(GLenum pname, GLint *data) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + + TRACE("(%d, %p)\n", pname, data); + funcs->gl.p_glGetIntegerv(pname, data); +} + +const GLubyte * WINAPI glGetStringi(GLenum name, GLuint index) +{ + const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; + + TRACE("(%d, %d)\n", name, index); + if (!funcs->ext.p_glGetStringi) + { + void **func_ptr = (void **)&funcs->ext.p_glGetStringi; + + *func_ptr = funcs->wgl.p_wglGetProcAddress("glGetStringi"); + } + + return funcs->ext.p_glGetStringi(name, index); +} + /* check if the extension is present in the list */ static BOOL has_extension( const char *list, const char *ext, size_t len ) { if (!list) { - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; const char *gl_ext; unsigned int i; GLint extensions_count; - if (!funcs->ext.p_glGetStringi) - { - void **func_ptr = (void **)&funcs->ext.p_glGetStringi; - - *func_ptr = funcs->wgl.p_wglGetProcAddress("glGetStringi"); - } - glGetIntegerv(GL_NUM_EXTENSIONS, &extensions_count); for (i = 0; i < extensions_count; ++i) { - gl_ext = (const char *)funcs->ext.p_glGetStringi(GL_EXTENSIONS, i); + gl_ext = (const char *)glGetStringi(GL_EXTENSIONS, i); if (!strncmp(gl_ext, ext, len) && !gl_ext[len]) return TRUE; }