mirror of
https://github.com/reactos/wine.git
synced 2025-02-09 21:55:12 +00:00
opengl32: Generate thunks for WGL extensions when possible.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
278c89a846
commit
c4e9e3fcb9
@ -169,12 +169,7 @@ sub GenerateThunk($$$)
|
||||
my $trace_call_arg = "";
|
||||
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_/;
|
||||
|
||||
my $ret = get_func_proto( "%s WINAPI %s(%s)", $name, $func_ref );
|
||||
my $ret = get_func_proto( "%s WINAPI %s(%s)", $name, $func_ref, 0 );
|
||||
foreach my $arg (@{$func_ref->[1]}) {
|
||||
my $ptype = get_arg_type( $arg );
|
||||
my $pname = get_arg_name( $arg );
|
||||
@ -192,13 +187,26 @@ sub GenerateThunk($$$)
|
||||
}
|
||||
$call_arg =~ s/,$/ /;
|
||||
$trace_arg =~ s/^, //;
|
||||
return "$ret DECLSPEC_HIDDEN;\n" if $name eq "glGetStringi";
|
||||
$ret .= "\n{\n const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n";
|
||||
$ret .= " TRACE( \"($trace_arg)\\n\"$trace_call_arg );\n" if $gen_traces;
|
||||
$ret .= "\n{\n";
|
||||
# special case for functions that take an HDC as first parameter
|
||||
if (@{$func_ref->[1]} && get_arg_type( ${$func_ref->[1]}[0] ) eq "HDC")
|
||||
{
|
||||
my $pname = get_arg_name( ${$func_ref->[1]}[0] );
|
||||
$ret .= " const struct opengl_funcs *funcs = get_dc_funcs( $pname );\n";
|
||||
$ret .= " TRACE( \"($trace_arg)\\n\"$trace_call_arg );\n" if $gen_traces;
|
||||
$ret .= " if (!funcs || !funcs->$prefix.p_$name) return";
|
||||
$ret .= " 0" unless is_void_func( $func_ref );
|
||||
$ret .= ";\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret .= " const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;\n";
|
||||
$ret .= " TRACE( \"($trace_arg)\\n\"$trace_call_arg );\n" if $gen_traces;
|
||||
}
|
||||
$ret .= " ";
|
||||
$ret .= "return " unless is_void_func( $func_ref );
|
||||
$ret .= "funcs->$prefix.p_$name($call_arg);\n";
|
||||
$ret .= "}\n";
|
||||
$ret .= "}\n\n";
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -209,7 +217,7 @@ sub generate_null_func($$)
|
||||
|
||||
return "" if $name eq "glDebugEntry";
|
||||
|
||||
$ret = get_func_proto( "static %s null_%s(%s)", $name, $func_ref );
|
||||
$ret = get_func_proto( "static %s null_%s(%s)", $name, $func_ref, 1 );
|
||||
$ret .= " {";
|
||||
if ($name eq "glGetError")
|
||||
{
|
||||
@ -264,16 +272,16 @@ sub get_arg_name($)
|
||||
return $name[0]->textContent();
|
||||
}
|
||||
|
||||
sub get_func_proto($$$)
|
||||
sub get_func_proto($$$$)
|
||||
{
|
||||
my ($format, $name, $func) = @_;
|
||||
my ($format, $name, $func, $convert_args) = @_;
|
||||
die "unknown func $name" unless defined $func->[0];
|
||||
my $proto = ConvertType( $func->[0] );
|
||||
my $proto = $convert_args ? ConvertType( $func->[0] ) : $func->[0]->textContent();
|
||||
$proto =~ s/ $//;
|
||||
my $args = "";
|
||||
foreach my $arg (@{$func->[1]})
|
||||
{
|
||||
$args .= " " . ConvertType( $arg ) . ",";
|
||||
$args .= " " . ($convert_args ? ConvertType( $arg ) : $arg->textContent()) . ",";
|
||||
}
|
||||
$args =~ s/,$/ /;
|
||||
$args ||= "void";
|
||||
@ -400,6 +408,32 @@ sub is_supported_api($)
|
||||
return 0;
|
||||
}
|
||||
|
||||
# some functions need a hand-written wrapper
|
||||
sub needs_wrapper($$)
|
||||
{
|
||||
my %funcs =
|
||||
(
|
||||
"glDebugEntry" => 1,
|
||||
"glGetIntegerv" => 1,
|
||||
"glGetString" => 1,
|
||||
"glGetStringi" => 1,
|
||||
"wglGetCurrentReadDCARB" => 1,
|
||||
);
|
||||
my ($name, $func) = @_;
|
||||
|
||||
return 1 if defined $funcs{$name};
|
||||
# check if return value needs special handling
|
||||
(my $type = $func->[0]->textContent()) =~ s/ $//;
|
||||
return 1 if defined $remap_types{$type};
|
||||
# check if one of the arguments needs special handling
|
||||
foreach (@{$func->[1]})
|
||||
{
|
||||
$type = get_arg_type( $_ );
|
||||
return 1 if defined $remap_types{$type};
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub parse_file($)
|
||||
{
|
||||
my $file = shift;
|
||||
@ -558,7 +592,7 @@ print HEADER " struct\n {\n";
|
||||
foreach (sort keys %wgl_functions)
|
||||
{
|
||||
next unless defined $supported_wgl_functions{$_};
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $wgl_functions{$_});
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $wgl_functions{$_}, 1);
|
||||
}
|
||||
print HEADER " } wgl;\n\n";
|
||||
|
||||
@ -566,14 +600,14 @@ print HEADER " struct\n {\n";
|
||||
foreach (sort keys %norm_functions)
|
||||
{
|
||||
next if $_ eq "glDebugEntry";
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $norm_functions{$_});
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $norm_functions{$_}, 1);
|
||||
}
|
||||
print HEADER " } gl;\n\n";
|
||||
|
||||
print HEADER " struct\n {\n";
|
||||
foreach (sort keys %ext_functions)
|
||||
{
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $ext_functions{$_});
|
||||
print HEADER get_func_proto(" %-10s (WINE_GLAPI *p_%s)(%s);\n", $_, $ext_functions{$_}, 1);
|
||||
}
|
||||
print HEADER " } ext;\n";
|
||||
print HEADER "};\n\n";
|
||||
@ -622,7 +656,7 @@ print HEADER "\n";
|
||||
|
||||
foreach (sort keys %norm_functions)
|
||||
{
|
||||
printf HEADER "%s;\n", get_func_proto("%-10s GLAPIENTRY %s(%s)", $_, $norm_functions{$_});
|
||||
printf HEADER "%s;\n", get_func_proto("%-10s GLAPIENTRY %s(%s)", $_, $norm_functions{$_}, 0);
|
||||
}
|
||||
|
||||
print HEADER "\n#endif /* __WINE_WGL_H */\n";
|
||||
@ -642,27 +676,25 @@ foreach (sort keys %wgl_functions) {
|
||||
|
||||
close(SPEC);
|
||||
|
||||
my $file_header =
|
||||
"/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */\n\n" .
|
||||
"#include \"config.h\"\n" .
|
||||
"#include <stdarg.h>\n" .
|
||||
"#include \"winternl.h\"\n" .
|
||||
"#include \"opengl_ext.h\"\n" .
|
||||
"#include \"wine/debug.h\"\n\n";
|
||||
|
||||
$file_header .= "WINE_DEFAULT_DEBUG_CHANNEL(opengl);\n\n" if $gen_traces;
|
||||
|
||||
#
|
||||
# After the spec file, the opengl_norm.c file
|
||||
#
|
||||
open(NORM, ">$norm_file") or die "cannot create $norm_file";
|
||||
print NORM "
|
||||
/* Auto-generated file... Do not edit ! */
|
||||
|
||||
#include \"config.h\"
|
||||
#include <stdarg.h>
|
||||
#include \"winternl.h\"
|
||||
#include \"wingdi.h\"
|
||||
#include \"wine/wgl.h\"
|
||||
#include \"wine/wgl_driver.h\"
|
||||
#include \"wine/debug.h\"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
|
||||
";
|
||||
print NORM $file_header;
|
||||
|
||||
foreach (sort keys %norm_functions) {
|
||||
my $string = GenerateThunk($_, $norm_functions{$_}, "gl");
|
||||
print NORM "\n$string" if $string;
|
||||
next if needs_wrapper( $_, $norm_functions{$_} );
|
||||
print NORM GenerateThunk($_, $norm_functions{$_}, "gl");
|
||||
}
|
||||
|
||||
foreach (sort keys %wgl_functions) {
|
||||
@ -694,35 +726,23 @@ close(NORM);
|
||||
# Finally, more complex, the opengl_ext.c file
|
||||
#
|
||||
open(EXT, ">$ext_file") or die "cannot create $ext_file";
|
||||
print EXT "
|
||||
/* Auto-generated file... Do not edit ! */
|
||||
|
||||
#include \"config.h\"
|
||||
#include <stdarg.h>
|
||||
#include \"opengl_ext.h\"
|
||||
#include \"winternl.h\"
|
||||
#include \"wingdi.h\"
|
||||
#include \"wine/wgl.h\"
|
||||
#define WGL_WGLEXT_PROTOTYPES
|
||||
#include \"wine/wglext.h\"
|
||||
#include \"wine/wgl_driver.h\"
|
||||
#include \"wine/debug.h\"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
|
||||
|
||||
";
|
||||
print EXT $file_header;
|
||||
|
||||
# The thunks themselves....
|
||||
my $count = keys %ext_functions;
|
||||
print EXT "const int extension_registry_size = $count;\n";
|
||||
my $wrappers = "";
|
||||
print EXT "const int extension_registry_size = $count;\n\n";
|
||||
foreach (sort keys %ext_functions) {
|
||||
my $string = GenerateThunk($_, $ext_functions{$_}, "ext");
|
||||
if ($string =~ /DECLSPEC_HIDDEN/) {
|
||||
print EXT "\n$string";
|
||||
} else {
|
||||
print EXT "\nstatic $string" if $string;
|
||||
if (needs_wrapper( $_, $ext_functions{$_} ))
|
||||
{
|
||||
$wrappers .= get_func_proto("extern %s WINAPI %s(%s) DECLSPEC_HIDDEN;\n", $_, $ext_functions{$_}, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
print EXT "static " . GenerateThunk($_, $ext_functions{$_}, "ext");
|
||||
}
|
||||
}
|
||||
print EXT $wrappers;
|
||||
|
||||
# Then the table giving the string <-> function correspondence */
|
||||
print EXT "\nconst OpenGL_extension extension_registry[$count] = {\n";
|
||||
|
@ -1,15 +1,9 @@
|
||||
|
||||
/* Auto-generated file... Do not edit ! */
|
||||
/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdarg.h>
|
||||
#include "opengl_ext.h"
|
||||
#include "winternl.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/wgl.h"
|
||||
#define WGL_WGLEXT_PROTOTYPES
|
||||
#include "wine/wglext.h"
|
||||
#include "wine/wgl_driver.h"
|
||||
#include "opengl_ext.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
|
||||
@ -6092,8 +6086,6 @@ static GLushort WINAPI glGetStageIndexNV( GLenum shadertype )
|
||||
return funcs->ext.p_glGetStageIndexNV( shadertype );
|
||||
}
|
||||
|
||||
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;
|
||||
@ -18421,6 +18413,124 @@ static void WINAPI glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLenum ou
|
||||
funcs->ext.p_glWriteMaskEXT( res, in, outX, outY, outZ, outW );
|
||||
}
|
||||
|
||||
static void * WINAPI wglAllocateMemoryNV( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "(%d, %f, %f, %f)\n", size, readfreq, writefreq, priority );
|
||||
return funcs->ext.p_wglAllocateMemoryNV( size, readfreq, writefreq, priority );
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
TRACE( "(%p, %p, %p, %u, %p, %p)\n", hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats );
|
||||
if (!funcs || !funcs->ext.p_wglChoosePixelFormatARB) return 0;
|
||||
return funcs->ext.p_wglChoosePixelFormatARB( hdc, piAttribIList, pfAttribFList, nMaxFormats, piFormats, nNumFormats );
|
||||
}
|
||||
|
||||
static void WINAPI wglFreeMemoryNV( void *pointer )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "(%p)\n", pointer );
|
||||
funcs->ext.p_wglFreeMemoryNV( pointer );
|
||||
}
|
||||
|
||||
static const char * WINAPI wglGetExtensionsStringARB( HDC hdc )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
TRACE( "(%p)\n", hdc );
|
||||
if (!funcs || !funcs->ext.p_wglGetExtensionsStringARB) return 0;
|
||||
return funcs->ext.p_wglGetExtensionsStringARB( hdc );
|
||||
}
|
||||
|
||||
static const char * WINAPI wglGetExtensionsStringEXT(void)
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "()\n" );
|
||||
return funcs->ext.p_wglGetExtensionsStringEXT();
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
TRACE( "(%p, %d, %d, %u, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues );
|
||||
if (!funcs || !funcs->ext.p_wglGetPixelFormatAttribfvARB) return 0;
|
||||
return funcs->ext.p_wglGetPixelFormatAttribfvARB( hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues );
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
TRACE( "(%p, %d, %d, %u, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues );
|
||||
if (!funcs || !funcs->ext.p_wglGetPixelFormatAttribivARB) return 0;
|
||||
return funcs->ext.p_wglGetPixelFormatAttribivARB( hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, piValues );
|
||||
}
|
||||
|
||||
static int WINAPI wglGetSwapIntervalEXT(void)
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "()\n" );
|
||||
return funcs->ext.p_wglGetSwapIntervalEXT();
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "(%d, %p)\n", attribute, value );
|
||||
return funcs->ext.p_wglQueryCurrentRendererIntegerWINE( attribute, value );
|
||||
}
|
||||
|
||||
static const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "(%d)\n", attribute );
|
||||
return funcs->ext.p_wglQueryCurrentRendererStringWINE( attribute );
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum attribute, GLuint *value )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( dc );
|
||||
TRACE( "(%p, %d, %d, %p)\n", dc, renderer, attribute, value );
|
||||
if (!funcs || !funcs->ext.p_wglQueryRendererIntegerWINE) return 0;
|
||||
return funcs->ext.p_wglQueryRendererIntegerWINE( dc, renderer, attribute, value );
|
||||
}
|
||||
|
||||
static const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( dc );
|
||||
TRACE( "(%p, %d, %d)\n", dc, renderer, attribute );
|
||||
if (!funcs || !funcs->ext.p_wglQueryRendererStringWINE) return 0;
|
||||
return funcs->ext.p_wglQueryRendererStringWINE( dc, renderer, attribute );
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
TRACE( "(%p, %d)\n", hdc, format );
|
||||
if (!funcs || !funcs->ext.p_wglSetPixelFormatWINE) return 0;
|
||||
return funcs->ext.p_wglSetPixelFormatWINE( hdc, format );
|
||||
}
|
||||
|
||||
static BOOL WINAPI wglSwapIntervalEXT( int interval )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
TRACE( "(%d)\n", interval );
|
||||
return funcs->ext.p_wglSwapIntervalEXT( interval );
|
||||
}
|
||||
|
||||
extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglBindTexImageARB( HPBUFFERARB hPbuffer, int iBuffer ) DECLSPEC_HIDDEN;
|
||||
extern HGLRC WINAPI wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList ) DECLSPEC_HIDDEN;
|
||||
extern HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB hPbuffer ) DECLSPEC_HIDDEN;
|
||||
extern HDC WINAPI wglGetCurrentReadDCARB(void) DECLSPEC_HIDDEN;
|
||||
extern HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB hPbuffer ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, HGLRC hglrc ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB hPbuffer, int iAttribute, int *piValue ) DECLSPEC_HIDDEN;
|
||||
extern int WINAPI wglReleasePbufferDCARB( HPBUFFERARB hPbuffer, HDC hDC ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB hPbuffer, int iBuffer ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB hPbuffer, const int *piAttribList ) DECLSPEC_HIDDEN;
|
||||
|
||||
const OpenGL_extension extension_registry[2655] = {
|
||||
{ "glAccumxOES", "GL_OES_fixed_point", glAccumxOES },
|
||||
{ "glAcquireKeyedMutexWin32EXT", "GL_EXT_win32_keyed_mutex", glAcquireKeyedMutexWin32EXT },
|
||||
|
@ -20,7 +20,10 @@
|
||||
#define __DLLS_OPENGL32_OPENGL_EXT_H
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/wgl.h"
|
||||
#include "wine/wgl_driver.h"
|
||||
|
||||
typedef struct {
|
||||
const char *name; /* name of the extension */
|
||||
@ -30,12 +33,14 @@ typedef struct {
|
||||
|
||||
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;
|
||||
|
||||
extern BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format ) DECLSPEC_HIDDEN;
|
||||
extern BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value ) DECLSPEC_HIDDEN;
|
||||
extern const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute );
|
||||
extern BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer,
|
||||
GLenum attribute, GLuint *value ) DECLSPEC_HIDDEN;
|
||||
extern const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute ) DECLSPEC_HIDDEN;
|
||||
static inline struct opengl_funcs *get_dc_funcs( HDC hdc )
|
||||
{
|
||||
struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION );
|
||||
if (!funcs) SetLastError( ERROR_INVALID_HANDLE );
|
||||
else if (funcs == (void *)-1) funcs = &null_opengl_funcs;
|
||||
return funcs;
|
||||
}
|
||||
|
||||
#endif /* __DLLS_OPENGL32_OPENGL_EXT_H */
|
||||
|
@ -1,12 +1,9 @@
|
||||
|
||||
/* Auto-generated file... Do not edit ! */
|
||||
/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdarg.h>
|
||||
#include "winternl.h"
|
||||
#include "wingdi.h"
|
||||
#include "wine/wgl.h"
|
||||
#include "wine/wgl_driver.h"
|
||||
#include "opengl_ext.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
|
||||
@ -2348,6 +2345,7 @@ void WINAPI glViewport( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
TRACE( "(%d, %d, %d, %d)\n", x, y, width, height );
|
||||
funcs->gl.p_glViewport( x, y, width, height );
|
||||
}
|
||||
|
||||
static BOOL null_wglCopyContext( struct wgl_context * hglrcSrc, struct wgl_context * hglrcDst, UINT mask ) { return 0; }
|
||||
static struct wgl_context * null_wglCreateContext( HDC hDc ) { return 0; }
|
||||
static BOOL null_wglDeleteContext( struct wgl_context * oldContext ) { return 0; }
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "opengl_ext.h"
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
@ -34,18 +33,14 @@
|
||||
#include "winternl.h"
|
||||
#include "winnt.h"
|
||||
|
||||
#define WGL_WGLEXT_PROTOTYPES
|
||||
#include "wine/wglext.h"
|
||||
#include "opengl_ext.h"
|
||||
#include "wine/gdi_driver.h"
|
||||
#include "wine/wgl_driver.h"
|
||||
#include "wine/glu.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(wgl);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(fps);
|
||||
|
||||
extern struct opengl_funcs null_opengl_funcs;
|
||||
|
||||
/* handle management */
|
||||
|
||||
#define MAX_WGL_HANDLES 1024
|
||||
@ -95,14 +90,6 @@ static CRITICAL_SECTION wgl_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||
|
||||
static const MAT2 identity = { {0,1},{0,0},{0,0},{0,1} };
|
||||
|
||||
static inline struct opengl_funcs *get_dc_funcs( HDC hdc )
|
||||
{
|
||||
struct opengl_funcs *funcs = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION );
|
||||
if (!funcs) SetLastError( ERROR_INVALID_HANDLE );
|
||||
else if (funcs == (void *)-1) funcs = &null_opengl_funcs;
|
||||
return funcs;
|
||||
}
|
||||
|
||||
static inline HANDLE next_handle( struct wgl_handle *ptr, enum wgl_handle_type type )
|
||||
{
|
||||
WORD generation = HIWORD( ptr->handle ) + 1;
|
||||
@ -970,31 +957,6 @@ BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglAllocateMemoryNV
|
||||
*
|
||||
* Provided by the WGL_NV_vertex_array_range extension.
|
||||
*/
|
||||
void * WINAPI wglAllocateMemoryNV( GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglAllocateMemoryNV) return NULL;
|
||||
return funcs->ext.p_wglAllocateMemoryNV( size, readfreq, writefreq, priority );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglFreeMemoryNV
|
||||
*
|
||||
* Provided by the WGL_NV_vertex_array_range extension.
|
||||
*/
|
||||
void WINAPI wglFreeMemoryNV( void *pointer )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (funcs->ext.p_wglFreeMemoryNV) funcs->ext.p_wglFreeMemoryNV( pointer );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglBindTexImageARB
|
||||
*
|
||||
@ -1043,48 +1005,6 @@ BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB handle, const int *attribs )
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglChoosePixelFormatARB
|
||||
*
|
||||
* Provided by the WGL_ARB_pixel_format extension.
|
||||
*/
|
||||
BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *iattribs, const FLOAT *fattribs,
|
||||
UINT max, int *formats, UINT *count )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglChoosePixelFormatARB) return FALSE;
|
||||
return funcs->ext.p_wglChoosePixelFormatARB( hdc, iattribs, fattribs, max, formats, count );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetPixelFormatAttribivARB
|
||||
*
|
||||
* Provided by the WGL_ARB_pixel_format extension.
|
||||
*/
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB( HDC hdc, int format, int layer, UINT count, const int *attribs,
|
||||
int *values )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglGetPixelFormatAttribivARB) return FALSE;
|
||||
return funcs->ext.p_wglGetPixelFormatAttribivARB( hdc, format, layer, count, attribs, values );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetPixelFormatAttribfvARB
|
||||
*
|
||||
* Provided by the WGL_ARB_pixel_format extension.
|
||||
*/
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int format, int layer, UINT count, const int *attribs,
|
||||
FLOAT *values )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglGetPixelFormatAttribfvARB) return FALSE;
|
||||
return funcs->ext.p_wglGetPixelFormatAttribfvARB( hdc, format, layer, count, attribs, values );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglCreatePbufferARB
|
||||
*
|
||||
@ -1166,123 +1086,6 @@ BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value )
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetExtensionsStringARB
|
||||
*
|
||||
* Provided by the WGL_ARB_extensions_string extension.
|
||||
*/
|
||||
const char * WINAPI wglGetExtensionsStringARB( HDC hdc )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglGetExtensionsStringARB) return NULL;
|
||||
return (const char *)funcs->ext.p_wglGetExtensionsStringARB( hdc );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetExtensionsStringEXT
|
||||
*
|
||||
* Provided by the WGL_EXT_extensions_string extension.
|
||||
*/
|
||||
const char * WINAPI wglGetExtensionsStringEXT(void)
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglGetExtensionsStringEXT) return NULL;
|
||||
return (const char *)funcs->ext.p_wglGetExtensionsStringEXT();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglSwapIntervalEXT
|
||||
*
|
||||
* Provided by the WGL_EXT_swap_control extension.
|
||||
*/
|
||||
BOOL WINAPI wglSwapIntervalEXT( int interval )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglSwapIntervalEXT) return FALSE;
|
||||
return funcs->ext.p_wglSwapIntervalEXT( interval );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglGetSwapIntervalEXT
|
||||
*
|
||||
* Provided by the WGL_EXT_swap_control extension.
|
||||
*/
|
||||
int WINAPI wglGetSwapIntervalEXT(void)
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglGetSwapIntervalEXT) return FALSE;
|
||||
return funcs->ext.p_wglGetSwapIntervalEXT();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglSetPixelFormatWINE
|
||||
*
|
||||
* Provided by the WGL_WINE_pixel_format_passthrough extension.
|
||||
*/
|
||||
BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( hdc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglSetPixelFormatWINE) return FALSE;
|
||||
return funcs->ext.p_wglSetPixelFormatWINE( hdc, format );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglQueryCurrentRendererIntegerWINE
|
||||
*
|
||||
* Provided by the WGL_WINE_query_renderer extension.
|
||||
*/
|
||||
BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglQueryCurrentRendererIntegerWINE) return FALSE;
|
||||
return funcs->ext.p_wglQueryCurrentRendererIntegerWINE( attribute, value );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglQueryCurrentRendererStringWINE
|
||||
*
|
||||
* Provided by the WGL_WINE_query_renderer extension.
|
||||
*/
|
||||
const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute )
|
||||
{
|
||||
const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
|
||||
|
||||
if (!funcs->ext.p_wglQueryCurrentRendererStringWINE) return NULL;
|
||||
return funcs->ext.p_wglQueryCurrentRendererStringWINE( attribute );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglQueryRendererIntegerWINE
|
||||
*
|
||||
* Provided by the WGL_WINE_query_renderer extension.
|
||||
*/
|
||||
BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum attribute, GLuint *value )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( dc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglQueryRendererIntegerWINE) return FALSE;
|
||||
return funcs->ext.p_wglQueryRendererIntegerWINE( dc, renderer, attribute, value );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglQueryRendererStringWINE
|
||||
*
|
||||
* Provided by the WGL_WINE_query_renderer extension.
|
||||
*/
|
||||
const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum attribute )
|
||||
{
|
||||
const struct opengl_funcs *funcs = get_dc_funcs( dc );
|
||||
|
||||
if (!funcs || !funcs->ext.p_wglQueryRendererStringWINE) return NULL;
|
||||
return funcs->ext.p_wglQueryRendererStringWINE( dc, renderer, attribute );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* wglUseFontBitmaps_common
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user