Commit 35f64cd7 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

opengl32: Move glGetString extension filtering to unix_wgl.c.

parent 720afb14
......@@ -162,7 +162,6 @@ my %manual_win_functions =
my %manual_win_thunks =
(
"glGetIntegerv" => 1,
"glGetString" => 1,
"wglGetCurrentReadDCARB" => 1,
"wglGetPixelFormat" => 1,
"wglGetProcAddress" => 1,
......@@ -510,7 +509,7 @@ sub needs_wrapper($$)
{
my ($name, $func) = @_;
return 1 if $name =~ /^glDebugMessageCallback|^glGetStringi/;
return 1 if $name =~ /^glDebugMessageCallback|^glGetString/;
# check if return value needs special handling
(my $type = $func->[0]->textContent()) =~ s/ $//;
......@@ -941,6 +940,12 @@ foreach (sort keys %wgl_functions)
next unless needs_wrapper( $_, $wgl_functions{$_} );
print OUT "extern NTSTATUS wgl_$_( void *args ) DECLSPEC_HIDDEN;\n";
}
foreach (sort keys %norm_functions)
{
next if defined $manual_win_functions{$_};
next unless needs_wrapper( $_, $norm_functions{$_} );
print OUT "extern NTSTATUS gl_$_( void *args ) DECLSPEC_HIDDEN;\n";
}
foreach (sort keys %ext_functions)
{
next if defined $manual_win_functions{$_};
......@@ -958,6 +963,7 @@ foreach (sort keys %wgl_functions)
foreach (sort keys %norm_functions)
{
next if defined $manual_win_functions{$_};
next if needs_wrapper( $_, $norm_functions{$_} );
print OUT generate_unix_thunk($_, $norm_functions{$_}, "gl");
}
foreach (sort keys %ext_functions)
......
......@@ -101,7 +101,6 @@ static inline enum wgl_handle_type get_current_context_type(void)
extern int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd );
extern BOOL filter_extensions( const char *extensions, GLubyte **exts_list, GLuint **disabled_exts ) DECLSPEC_HIDDEN;
extern const GLuint *disabled_extensions_index(void) DECLSPEC_HIDDEN;
extern BOOL check_extension_support( const char *extension, const char *available_extensions ) DECLSPEC_HIDDEN;
extern char *build_extension_list(void) DECLSPEC_HIDDEN;
......
......@@ -1011,6 +1011,15 @@ void WINAPI glGetPolygonStipple( GLubyte *mask )
if ((status = UNIX_CALL( glGetPolygonStipple, &args ))) WARN( "glGetPolygonStipple returned %#x\n", status );
}
const GLubyte * WINAPI glGetString( GLenum name )
{
struct glGetString_params args = { .name = name, };
NTSTATUS status;
TRACE( "name %d\n", name );
if ((status = UNIX_CALL( glGetString, &args ))) WARN( "glGetString returned %#x\n", status );
return args.ret;
}
void WINAPI glGetTexEnvfv( GLenum target, GLenum pname, GLfloat *params )
{
struct glGetTexEnvfv_params args = { .target = target, .pname = pname, .params = params, };
......@@ -18,6 +18,7 @@ extern NTSTATUS wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS wgl_wglShareLists( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS gl_glGetString( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS ext_glDebugMessageCallback( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS ext_glDebugMessageCallbackAMD( void *args ) DECLSPEC_HIDDEN;
extern NTSTATUS ext_glDebugMessageCallbackARB( void *args ) DECLSPEC_HIDDEN;
......@@ -1009,14 +1010,6 @@ static NTSTATUS gl_glGetPolygonStipple( void *args )
return STATUS_SUCCESS;
}
static NTSTATUS gl_glGetString( void *args )
{
struct glGetString_params *params = args;
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
params->ret = funcs->gl.p_glGetString( params->name );
return STATUS_SUCCESS;
}
static NTSTATUS gl_glGetTexEnvfv( void *args )
{
struct glGetTexEnvfv_params *params = args;
......@@ -195,7 +195,7 @@ static GLuint *filter_extensions_index( const char *disabled )
}
/* build the extension string by filtering out the disabled extensions */
BOOL filter_extensions( const char *extensions, GLubyte **exts_list, GLuint **disabled_exts )
static BOOL filter_extensions( const char *extensions, GLubyte **exts_list, GLuint **disabled_exts )
{
static const char *disabled;
......@@ -286,6 +286,22 @@ BOOL check_extension_support( const char *extension, const char *available_exten
return FALSE;
}
static const GLubyte * WINAPI wrap_glGetString( GLenum name )
{
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
const GLubyte *ret;
if ((ret = funcs->gl.p_glGetString( name )) && name == GL_EXTENSIONS)
{
struct wgl_handle *ptr = get_current_context_ptr();
GLubyte **extensions = &ptr->u.context->extensions;
GLuint **disabled = &ptr->u.context->disabled_exts;
if (*extensions || filter_extensions( (const char *)ret, extensions, disabled )) return *extensions;
}
return ret;
}
static const GLubyte * WINAPI wrap_glGetStringi( GLenum name, GLuint index )
{
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
......@@ -711,6 +727,13 @@ NTSTATUS wgl_wglShareLists( void *args )
return STATUS_SUCCESS;
}
NTSTATUS gl_glGetString( void *args )
{
struct glGetString_params *params = args;
params->ret = wrap_glGetString( params->name );
return STATUS_SUCCESS;
}
NTSTATUS ext_glDebugMessageCallback( void *args )
{
struct glDebugMessageCallback_params *params = args;
......
......@@ -955,29 +955,6 @@ GLint WINAPI glDebugEntry( GLint unknown1, GLint unknown2 )
return 0;
}
/***********************************************************************
* glGetString (OPENGL32.@)
*/
const GLubyte * WINAPI glGetString( GLenum name )
{
struct glGetString_params args = { .name = name, };
NTSTATUS status;
TRACE( "name %d\n", name );
if ((status = UNIX_CALL( glGetString, &args ))) WARN( "glGetString returned %#x\n", status );
if (name == GL_EXTENSIONS && args.ret)
{
struct wgl_handle *ptr = get_current_context_ptr();
GLubyte **extensions = &ptr->u.context->extensions;
GLuint **disabled = &ptr->u.context->disabled_exts;
if (*extensions || filter_extensions( (const char *)args.ret, extensions, disabled )) return *extensions;
}
return args.ret;
}
static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_message_params *params, ULONG size )
{
params->user_callback( params->source, params->type, params->id, params->severity,
......
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