From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 90 +++++++++++-------- dlls/opengl32/thunks.c | 172 +++++++++++++++++++++++++++++++++--- dlls/opengl32/unix_thunks.c | 166 ++++------------------------------ dlls/opengl32/unix_wgl.c | 168 ++++++++++++++++++++++++++++++----- 4 files changed, 374 insertions(+), 222 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index f178ba462d0..78368ec6c2f 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -140,6 +140,36 @@ my %khronos_types = "khronos_uint32_t" => "unsigned int", "khronos_float_t" => "float", ); + +my %manual_win_functions = + ( + "glDebugEntry" => 1, + "wglChoosePixelFormat" => 1, + "wglCreateLayerContext" => 1, + "wglDescribeLayerPlane" => 1, + "wglGetCurrentContext" => 1, + "wglGetCurrentDC" => 1, + "wglGetDefaultProcAddress" => 1, + "wglGetLayerPaletteEntries" => 1, + "wglRealizeLayerPalette" => 1, + "wglSetLayerPaletteEntries" => 1, + "wglSwapLayerBuffers" => 1, + "wglUseFontBitmapsA" => 1, + "wglUseFontBitmapsW" => 1, + "wglUseFontOutlinesA" => 1, + "wglUseFontOutlinesW" => 1, + ); +my %manual_win_thunks = + ( + "glGetIntegerv" => 1, + "glGetString" => 1, + "glGetStringi" => 1, + "wglGetCurrentReadDCARB" => 1, + "wglGetPixelFormat" => 1, + "wglGetProcAddress" => 1, + "wglSwapBuffers" => 1, + ); + # # Used to convert some types # @@ -419,25 +449,6 @@ my %wgl_functions; my %gl_enums; my (%gl_types, @gl_types); # also use an array to preserve declaration order
-my %manual_win_functions = - ( - "glDebugEntry" => 1, - "wglChoosePixelFormat" => 1, - "wglCreateLayerContext" => 1, - "wglDescribeLayerPlane" => 1, - "wglGetCurrentContext" => 1, - "wglGetCurrentDC" => 1, - "wglGetDefaultProcAddress" => 1, - "wglGetLayerPaletteEntries" => 1, - "wglRealizeLayerPalette" => 1, - "wglSetLayerPaletteEntries" => 1, - "wglSwapLayerBuffers" => 1, - "wglUseFontBitmapsA" => 1, - "wglUseFontBitmapsW" => 1, - "wglUseFontOutlinesA" => 1, - "wglUseFontOutlinesW" => 1, - ); - my %remapped_wgl_functions = ( "ChoosePixelFormat" => "wglChoosePixelFormat", @@ -498,23 +509,10 @@ sub is_supported_api($) # some functions need a hand-written wrapper sub needs_wrapper($$) { - my %funcs = - ( - "glDebugEntry" => 1, - "glDebugMessageCallback" => 1, - "glDebugMessageCallbackAMD" => 1, - "glDebugMessageCallbackARB" => 1, - "glGetIntegerv" => 1, - "glGetString" => 1, - "glGetStringi" => 1, - "wglGetCurrentReadDCARB" => 1, - "wglGetPixelFormat" => 1, - "wglGetProcAddress" => 1, - "wglSwapBuffers" => 1, - ); my ($name, $func) = @_;
- return 1 if defined $funcs{$name}; + return 1 if $name =~ /^glDebugMessageCallback/; + # check if return value needs special handling (my $type = $func->[0]->textContent()) =~ s/ $//; return 1 if defined $remap_types{$type}; @@ -881,26 +879,26 @@ print OUT "WINE_DEFAULT_DEBUG_CHANNEL(opengl);\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; - next if needs_wrapper( $_, $wgl_functions{$_} ); + next if defined $manual_win_thunks{$_}; print OUT "\n" . generate_win_thunk($_, $wgl_functions{$_}); } foreach (sort keys %norm_functions) { next if defined $manual_win_functions{$_}; - next if needs_wrapper( $_, $norm_functions{$_} ); + next if defined $manual_win_thunks{$_}; print OUT "\n" . generate_win_thunk($_, $norm_functions{$_}); } foreach (sort keys %ext_functions) { next if defined $manual_win_functions{$_}; - next if needs_wrapper( $_, $ext_functions{$_} ); + next if defined $manual_win_thunks{$_}; print OUT "\nstatic " . generate_win_thunk($_, $ext_functions{$_}); } print OUT "\n";
foreach (sort keys %ext_functions) { - next unless defined $manual_win_functions{$_} || needs_wrapper( $_, $ext_functions{$_} ); + next unless defined $manual_win_functions{$_} || $manual_win_thunks{$_}; my $decl_args = get_func_args( $ext_functions{$_}, 1, 0, "" ); my $func_ret = get_func_ret( $ext_functions{$_}, 0 ); printf OUT "extern %s WINAPI %s(%s) DECLSPEC_HIDDEN;\n", $func_ret, $_, $decl_args; @@ -941,6 +939,21 @@ print OUT "#include "opengl_ext.h"\n\n"; foreach (sort keys %wgl_functions) { next if defined $manual_win_functions{$_}; + next unless needs_wrapper( $_, $wgl_functions{$_} ); + print OUT "extern NTSTATUS wgl_$_( void *args ) DECLSPEC_HIDDEN;\n"; +} +foreach (sort keys %ext_functions) +{ + next if defined $manual_win_functions{$_}; + next unless needs_wrapper( $_, $ext_functions{$_} ); + print OUT "extern NTSTATUS ext_$_( void *args ) DECLSPEC_HIDDEN;\n"; +} +print OUT "\n"; + +foreach (sort keys %wgl_functions) +{ + next if defined $manual_win_functions{$_}; + next if needs_wrapper( $_, $wgl_functions{$_} ); print OUT generate_unix_thunk($_, $wgl_functions{$_}, "wgl"); } foreach (sort keys %norm_functions) @@ -951,6 +964,7 @@ foreach (sort keys %norm_functions) foreach (sort keys %ext_functions) { next if defined $manual_win_functions{$_}; + next if needs_wrapper( $_, $ext_functions{$_} ); print OUT generate_unix_thunk($_, $ext_functions{$_}, "ext"); }
diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index b54a2952975..a2a78bff97d 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -17,6 +17,33 @@
WINE_DEFAULT_DEBUG_CHANNEL(opengl);
+BOOL WINAPI wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) +{ + struct wglCopyContext_params args = { .hglrcSrc = hglrcSrc, .hglrcDst = hglrcDst, .mask = mask, }; + NTSTATUS status; + TRACE( "hglrcSrc %p, hglrcDst %p, mask %u\n", hglrcSrc, hglrcDst, mask ); + if ((status = UNIX_CALL( wglCopyContext, &args ))) WARN( "wglCopyContext returned %#x\n", status ); + return args.ret; +} + +HGLRC WINAPI wglCreateContext( HDC hDc ) +{ + struct wglCreateContext_params args = { .hDc = hDc, }; + NTSTATUS status; + TRACE( "hDc %p\n", hDc ); + if ((status = UNIX_CALL( wglCreateContext, &args ))) WARN( "wglCreateContext returned %#x\n", status ); + return args.ret; +} + +BOOL WINAPI wglDeleteContext( HGLRC oldContext ) +{ + struct wglDeleteContext_params args = { .oldContext = oldContext, }; + NTSTATUS status; + TRACE( "oldContext %p\n", oldContext ); + if ((status = UNIX_CALL( wglDeleteContext, &args ))) WARN( "wglDeleteContext returned %#x\n", status ); + return args.ret; +} + int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR *ppfd ) { struct wglDescribePixelFormat_params args = { .hdc = hdc, .ipfd = ipfd, .cjpfd = cjpfd, .ppfd = ppfd, }; @@ -26,6 +53,15 @@ int WINAPI wglDescribePixelFormat( HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDES return args.ret; }
+BOOL WINAPI wglMakeCurrent( HDC hDc, HGLRC newContext ) +{ + struct wglMakeCurrent_params args = { .hDc = hDc, .newContext = newContext, }; + NTSTATUS status; + TRACE( "hDc %p, newContext %p\n", hDc, newContext ); + if ((status = UNIX_CALL( wglMakeCurrent, &args ))) WARN( "wglMakeCurrent returned %#x\n", status ); + return args.ret; +} + BOOL WINAPI wglSetPixelFormat( HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *ppfd ) { struct wglSetPixelFormat_params args = { .hdc = hdc, .ipfd = ipfd, .ppfd = ppfd, }; @@ -35,6 +71,15 @@ BOOL WINAPI wglSetPixelFormat( HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR *p return args.ret; }
+BOOL WINAPI wglShareLists( HGLRC hrcSrvShare, HGLRC hrcSrvSource ) +{ + struct wglShareLists_params args = { .hrcSrvShare = hrcSrvShare, .hrcSrvSource = hrcSrvSource, }; + NTSTATUS status; + TRACE( "hrcSrvShare %p, hrcSrvSource %p\n", hrcSrvShare, hrcSrvSource ); + if ((status = UNIX_CALL( wglShareLists, &args ))) WARN( "wglShareLists returned %#x\n", status ); + return args.ret; +} + void WINAPI glAccum( GLenum op, GLfloat value ) { struct glAccum_params args = { .op = op, .value = value, }; @@ -5418,6 +5463,30 @@ static void WINAPI glCurrentPaletteMatrixARB( GLint index ) if ((status = UNIX_CALL( glCurrentPaletteMatrixARB, &args ))) WARN( "glCurrentPaletteMatrixARB returned %#x\n", status ); }
+static void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) +{ + struct glDebugMessageCallback_params args = { .callback = callback, .userParam = userParam, }; + NTSTATUS status; + TRACE( "callback %p, userParam %p\n", callback, userParam ); + if ((status = UNIX_CALL( glDebugMessageCallback, &args ))) WARN( "glDebugMessageCallback returned %#x\n", status ); +} + +static void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) +{ + struct glDebugMessageCallbackAMD_params args = { .callback = callback, .userParam = userParam, }; + NTSTATUS status; + TRACE( "callback %p, userParam %p\n", callback, userParam ); + if ((status = UNIX_CALL( glDebugMessageCallbackAMD, &args ))) WARN( "glDebugMessageCallbackAMD returned %#x\n", status ); +} + +static void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) +{ + struct glDebugMessageCallbackARB_params args = { .callback = callback, .userParam = userParam, }; + NTSTATUS status; + TRACE( "callback %p, userParam %p\n", callback, userParam ); + if ((status = UNIX_CALL( glDebugMessageCallbackARB, &args ))) WARN( "glDebugMessageCallbackARB returned %#x\n", status ); +} + static void WINAPI glDebugMessageControl( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) { struct glDebugMessageControl_params args = { .source = source, .type = type, .severity = severity, .count = count, .ids = ids, .enabled = enabled, }; @@ -24187,6 +24256,15 @@ static void * WINAPI wglAllocateMemoryNV( GLsizei size, GLfloat readfreq, GLfloa return args.ret; }
+static BOOL WINAPI wglBindTexImageARB( HPBUFFERARB hPbuffer, int iBuffer ) +{ + struct wglBindTexImageARB_params args = { .hPbuffer = hPbuffer, .iBuffer = iBuffer, }; + NTSTATUS status; + TRACE( "hPbuffer %p, iBuffer %d\n", hPbuffer, iBuffer ); + if ((status = UNIX_CALL( wglBindTexImageARB, &args ))) WARN( "wglBindTexImageARB returned %#x\n", status ); + return args.ret; +} + static BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats ) { struct wglChoosePixelFormatARB_params args = { .hdc = hdc, .piAttribIList = piAttribIList, .pfAttribFList = pfAttribFList, .nMaxFormats = nMaxFormats, .piFormats = piFormats, .nNumFormats = nNumFormats, }; @@ -24196,6 +24274,33 @@ static BOOL WINAPI wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, c return args.ret; }
+static HGLRC WINAPI wglCreateContextAttribsARB( HDC hDC, HGLRC hShareContext, const int *attribList ) +{ + struct wglCreateContextAttribsARB_params args = { .hDC = hDC, .hShareContext = hShareContext, .attribList = attribList, }; + NTSTATUS status; + TRACE( "hDC %p, hShareContext %p, attribList %p\n", hDC, hShareContext, attribList ); + if ((status = UNIX_CALL( wglCreateContextAttribsARB, &args ))) WARN( "wglCreateContextAttribsARB returned %#x\n", status ); + return args.ret; +} + +static HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList ) +{ + struct wglCreatePbufferARB_params args = { .hDC = hDC, .iPixelFormat = iPixelFormat, .iWidth = iWidth, .iHeight = iHeight, .piAttribList = piAttribList, }; + NTSTATUS status; + TRACE( "hDC %p, iPixelFormat %d, iWidth %d, iHeight %d, piAttribList %p\n", hDC, iPixelFormat, iWidth, iHeight, piAttribList ); + if ((status = UNIX_CALL( wglCreatePbufferARB, &args ))) WARN( "wglCreatePbufferARB returned %#x\n", status ); + return args.ret; +} + +static BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB hPbuffer ) +{ + struct wglDestroyPbufferARB_params args = { .hPbuffer = hPbuffer, }; + NTSTATUS status; + TRACE( "hPbuffer %p\n", hPbuffer ); + if ((status = UNIX_CALL( wglDestroyPbufferARB, &args ))) WARN( "wglDestroyPbufferARB returned %#x\n", status ); + return args.ret; +} + static void WINAPI wglFreeMemoryNV( void *pointer ) { struct wglFreeMemoryNV_params args = { .pointer = pointer, }; @@ -24222,6 +24327,15 @@ static const char * WINAPI wglGetExtensionsStringEXT(void) return args.ret; }
+static HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB hPbuffer ) +{ + struct wglGetPbufferDCARB_params args = { .hPbuffer = hPbuffer, }; + NTSTATUS status; + TRACE( "hPbuffer %p\n", hPbuffer ); + if ((status = UNIX_CALL( wglGetPbufferDCARB, &args ))) WARN( "wglGetPbufferDCARB returned %#x\n", status ); + return args.ret; +} + static BOOL WINAPI wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues ) { struct wglGetPixelFormatAttribfvARB_params args = { .hdc = hdc, .iPixelFormat = iPixelFormat, .iLayerPlane = iLayerPlane, .nAttributes = nAttributes, .piAttributes = piAttributes, .pfValues = pfValues, }; @@ -24249,6 +24363,15 @@ static int WINAPI wglGetSwapIntervalEXT(void) return args.ret; }
+static BOOL WINAPI wglMakeContextCurrentARB( HDC hDrawDC, HDC hReadDC, HGLRC hglrc ) +{ + struct wglMakeContextCurrentARB_params args = { .hDrawDC = hDrawDC, .hReadDC = hReadDC, .hglrc = hglrc, }; + NTSTATUS status; + TRACE( "hDrawDC %p, hReadDC %p, hglrc %p\n", hDrawDC, hReadDC, hglrc ); + if ((status = UNIX_CALL( wglMakeContextCurrentARB, &args ))) WARN( "wglMakeContextCurrentARB returned %#x\n", status ); + return args.ret; +} + static BOOL WINAPI wglQueryCurrentRendererIntegerWINE( GLenum attribute, GLuint *value ) { struct wglQueryCurrentRendererIntegerWINE_params args = { .attribute = attribute, .value = value, }; @@ -24267,6 +24390,15 @@ static const GLchar * WINAPI wglQueryCurrentRendererStringWINE( GLenum attribute return args.ret; }
+static BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB hPbuffer, int iAttribute, int *piValue ) +{ + struct wglQueryPbufferARB_params args = { .hPbuffer = hPbuffer, .iAttribute = iAttribute, .piValue = piValue, }; + NTSTATUS status; + TRACE( "hPbuffer %p, iAttribute %d, piValue %p\n", hPbuffer, iAttribute, piValue ); + if ((status = UNIX_CALL( wglQueryPbufferARB, &args ))) WARN( "wglQueryPbufferARB returned %#x\n", status ); + return args.ret; +} + static BOOL WINAPI wglQueryRendererIntegerWINE( HDC dc, GLint renderer, GLenum attribute, GLuint *value ) { struct wglQueryRendererIntegerWINE_params args = { .dc = dc, .renderer = renderer, .attribute = attribute, .value = value, }; @@ -24285,6 +24417,33 @@ static const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, return args.ret; }
+static int WINAPI wglReleasePbufferDCARB( HPBUFFERARB hPbuffer, HDC hDC ) +{ + struct wglReleasePbufferDCARB_params args = { .hPbuffer = hPbuffer, .hDC = hDC, }; + NTSTATUS status; + TRACE( "hPbuffer %p, hDC %p\n", hPbuffer, hDC ); + if ((status = UNIX_CALL( wglReleasePbufferDCARB, &args ))) WARN( "wglReleasePbufferDCARB returned %#x\n", status ); + return args.ret; +} + +static BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB hPbuffer, int iBuffer ) +{ + struct wglReleaseTexImageARB_params args = { .hPbuffer = hPbuffer, .iBuffer = iBuffer, }; + NTSTATUS status; + TRACE( "hPbuffer %p, iBuffer %d\n", hPbuffer, iBuffer ); + if ((status = UNIX_CALL( wglReleaseTexImageARB, &args ))) WARN( "wglReleaseTexImageARB returned %#x\n", status ); + return args.ret; +} + +static BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB hPbuffer, const int *piAttribList ) +{ + struct wglSetPbufferAttribARB_params args = { .hPbuffer = hPbuffer, .piAttribList = piAttribList, }; + NTSTATUS status; + TRACE( "hPbuffer %p, piAttribList %p\n", hPbuffer, piAttribList ); + if ((status = UNIX_CALL( wglSetPbufferAttribARB, &args ))) WARN( "wglSetPbufferAttribARB returned %#x\n", status ); + return args.ret; +} + static BOOL WINAPI wglSetPixelFormatWINE( HDC hdc, int format ) { struct wglSetPixelFormatWINE_params args = { .hdc = hdc, .format = format, }; @@ -24303,21 +24462,8 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) return args.ret; }
-extern void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) DECLSPEC_HIDDEN; -extern void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) DECLSPEC_HIDDEN; -extern void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) DECLSPEC_HIDDEN; 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 int extension_registry_size = 2694; const OpenGL_extension extension_registry[2694] = diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 1efbd1d192a..86af754b278 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -13,30 +13,24 @@
#include "opengl_ext.h"
-static NTSTATUS wgl_wglCopyContext( void *args ) -{ - struct wglCopyContext_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->wgl.p_wglCopyContext( (struct wgl_context *)params->hglrcSrc, (struct wgl_context *)params->hglrcDst, params->mask ); - return STATUS_SUCCESS; -} - -static NTSTATUS wgl_wglCreateContext( void *args ) -{ - struct wglCreateContext_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); - if (!funcs || !funcs->wgl.p_wglCreateContext) return STATUS_NOT_IMPLEMENTED; - params->ret = (HGLRC)funcs->wgl.p_wglCreateContext( params->hDc ); - return STATUS_SUCCESS; -} - -static NTSTATUS wgl_wglDeleteContext( void *args ) -{ - struct wglDeleteContext_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->wgl.p_wglDeleteContext( (struct wgl_context *)params->oldContext ); - return STATUS_SUCCESS; -} +extern NTSTATUS wgl_wglCopyContext( void *args ) DECLSPEC_HIDDEN; +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 ext_glDebugMessageCallback( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glDebugMessageCallbackAMD( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glDebugMessageCallbackARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglBindTexImageARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglDestroyPbufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglGetPbufferDCARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglMakeContextCurrentARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglQueryPbufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglReleasePbufferDCARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglReleaseTexImageARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_wglSetPbufferAttribARB( void *args ) DECLSPEC_HIDDEN;
static NTSTATUS wgl_wglDescribePixelFormat( void *args ) { @@ -64,15 +58,6 @@ static NTSTATUS wgl_wglGetProcAddress( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS wgl_wglMakeCurrent( void *args ) -{ - struct wglMakeCurrent_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDc ); - if (!funcs || !funcs->wgl.p_wglMakeCurrent) return STATUS_NOT_IMPLEMENTED; - params->ret = funcs->wgl.p_wglMakeCurrent( params->hDc, (struct wgl_context *)params->newContext ); - return STATUS_SUCCESS; -} - static NTSTATUS wgl_wglSetPixelFormat( void *args ) { struct wglSetPixelFormat_params *params = args; @@ -82,14 +67,6 @@ static NTSTATUS wgl_wglSetPixelFormat( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS wgl_wglShareLists( void *args ) -{ - struct wglShareLists_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->wgl.p_wglShareLists( (struct wgl_context *)params->hrcSrvShare, (struct wgl_context *)params->hrcSrvSource ); - return STATUS_SUCCESS; -} - static NTSTATUS wgl_wglSwapBuffers( void *args ) { struct wglSwapBuffers_params *params = args; @@ -5451,30 +5428,6 @@ static NTSTATUS ext_glCurrentPaletteMatrixARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glDebugMessageCallback( void *args ) -{ - struct glDebugMessageCallback_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - funcs->ext.p_glDebugMessageCallback( params->callback, params->userParam ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_glDebugMessageCallbackAMD( void *args ) -{ - struct glDebugMessageCallbackAMD_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - funcs->ext.p_glDebugMessageCallbackAMD( params->callback, params->userParam ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_glDebugMessageCallbackARB( void *args ) -{ - struct glDebugMessageCallbackARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - funcs->ext.p_glDebugMessageCallbackARB( params->callback, params->userParam ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_glDebugMessageControl( void *args ) { struct glDebugMessageControl_params *params = args; @@ -24098,14 +24051,6 @@ static NTSTATUS ext_wglAllocateMemoryNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglBindTexImageARB( void *args ) -{ - struct wglBindTexImageARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglBindTexImageARB( (struct wgl_pbuffer *)params->hPbuffer, params->iBuffer ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglChoosePixelFormatARB( void *args ) { struct wglChoosePixelFormatARB_params *params = args; @@ -24115,32 +24060,6 @@ static NTSTATUS ext_wglChoosePixelFormatARB( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglCreateContextAttribsARB( void *args ) -{ - struct wglCreateContextAttribsARB_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); - if (!funcs || !funcs->ext.p_wglCreateContextAttribsARB) return STATUS_NOT_IMPLEMENTED; - params->ret = (HGLRC)funcs->ext.p_wglCreateContextAttribsARB( params->hDC, (struct wgl_context *)params->hShareContext, params->attribList ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_wglCreatePbufferARB( void *args ) -{ - struct wglCreatePbufferARB_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDC ); - if (!funcs || !funcs->ext.p_wglCreatePbufferARB) return STATUS_NOT_IMPLEMENTED; - params->ret = (HPBUFFERARB)funcs->ext.p_wglCreatePbufferARB( params->hDC, params->iPixelFormat, params->iWidth, params->iHeight, params->piAttribList ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_wglDestroyPbufferARB( void *args ) -{ - struct wglDestroyPbufferARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglDestroyPbufferARB( (struct wgl_pbuffer *)params->hPbuffer ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglFreeMemoryNV( void *args ) { struct wglFreeMemoryNV_params *params = args; @@ -24174,14 +24093,6 @@ static NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglGetPbufferDCARB( void *args ) -{ - struct wglGetPbufferDCARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglGetPbufferDCARB( (struct wgl_pbuffer *)params->hPbuffer ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglGetPixelFormatAttribfvARB( void *args ) { struct wglGetPixelFormatAttribfvARB_params *params = args; @@ -24208,15 +24119,6 @@ static NTSTATUS ext_wglGetSwapIntervalEXT( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglMakeContextCurrentARB( void *args ) -{ - struct wglMakeContextCurrentARB_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hDrawDC ); - if (!funcs || !funcs->ext.p_wglMakeContextCurrentARB) return STATUS_NOT_IMPLEMENTED; - params->ret = funcs->ext.p_wglMakeContextCurrentARB( params->hDrawDC, params->hReadDC, (struct wgl_context *)params->hglrc ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglQueryCurrentRendererIntegerWINE( void *args ) { struct wglQueryCurrentRendererIntegerWINE_params *params = args; @@ -24233,14 +24135,6 @@ static NTSTATUS ext_wglQueryCurrentRendererStringWINE( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglQueryPbufferARB( void *args ) -{ - struct wglQueryPbufferARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglQueryPbufferARB( (struct wgl_pbuffer *)params->hPbuffer, params->iAttribute, params->piValue ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglQueryRendererIntegerWINE( void *args ) { struct wglQueryRendererIntegerWINE_params *params = args; @@ -24259,30 +24153,6 @@ static NTSTATUS ext_wglQueryRendererStringWINE( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglReleasePbufferDCARB( void *args ) -{ - struct wglReleasePbufferDCARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglReleasePbufferDCARB( (struct wgl_pbuffer *)params->hPbuffer, params->hDC ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_wglReleaseTexImageARB( void *args ) -{ - struct wglReleaseTexImageARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglReleaseTexImageARB( (struct wgl_pbuffer *)params->hPbuffer, params->iBuffer ); - return STATUS_SUCCESS; -} - -static NTSTATUS ext_wglSetPbufferAttribARB( void *args ) -{ - struct wglSetPbufferAttribARB_params *params = args; - const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; - params->ret = funcs->ext.p_wglSetPbufferAttribARB( (struct wgl_pbuffer *)params->hPbuffer, params->piAttribList ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglSetPixelFormatWINE( void *args ) { struct wglSetPixelFormatWINE_params *params = args; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 70ee0a5cdab..4771205a47e 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -35,8 +35,6 @@
#include "wine/debug.h"
-WINE_DEFAULT_DEBUG_CHANNEL(wgl); - struct wgl_handle wgl_handles[MAX_WGL_HANDLES]; static struct wgl_handle *next_free; static unsigned int handle_count; @@ -107,7 +105,7 @@ static void free_handle_ptr( struct wgl_handle *ptr ) LeaveCriticalSection( &wgl_section ); }
-BOOL WINAPI wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) +static BOOL wrap_wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) { struct wgl_handle *src, *dst; BOOL ret = FALSE; @@ -123,7 +121,7 @@ BOOL WINAPI wglCopyContext( HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask ) return ret; }
-HGLRC WINAPI wglCreateContext( HDC hdc ) +static HGLRC wrap_wglCreateContext( HDC hdc ) { HGLRC ret = 0; struct wgl_context *drv_ctx; @@ -142,7 +140,7 @@ HGLRC WINAPI wglCreateContext( HDC hdc ) return ret; }
-BOOL WINAPI wglDeleteContext( HGLRC hglrc ) +static BOOL wrap_wglDeleteContext( HGLRC hglrc ) { struct wgl_handle *ptr = get_handle_ptr( hglrc, HANDLE_CONTEXT );
@@ -163,7 +161,7 @@ BOOL WINAPI wglDeleteContext( HGLRC hglrc ) return TRUE; }
-BOOL WINAPI wglMakeCurrent( HDC hdc, HGLRC hglrc ) +static BOOL wrap_wglMakeCurrent( HDC hdc, HGLRC hglrc ) { BOOL ret = TRUE; struct wgl_handle *ptr, *prev = get_current_context_ptr(); @@ -206,7 +204,7 @@ BOOL WINAPI wglMakeCurrent( HDC hdc, HGLRC hglrc ) return ret; }
-BOOL WINAPI wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst ) +static BOOL wrap_wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst ) { BOOL ret = FALSE; struct wgl_handle *src, *dst; @@ -222,7 +220,7 @@ BOOL WINAPI wglShareLists( HGLRC hglrcSrc, HGLRC hglrcDst ) return ret; }
-BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer ) +static BOOL wrap_wglBindTexImageARB( HPBUFFERARB handle, int buffer ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); BOOL ret; @@ -233,7 +231,7 @@ BOOL WINAPI wglBindTexImageARB( HPBUFFERARB handle, int buffer ) return ret; }
-HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attribs ) +static HGLRC wrap_wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attribs ) { HGLRC ret = 0; struct wgl_context *drv_ctx; @@ -281,7 +279,7 @@ HGLRC WINAPI wglCreateContextAttribsARB( HDC hdc, HGLRC share, const int *attrib return ret; }
-HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int height, const int *attribs ) +static HPBUFFERARB wrap_wglCreatePbufferARB( HDC hdc, int format, int width, int height, const int *attribs ) { HPBUFFERARB ret; struct wgl_pbuffer *pbuffer; @@ -294,7 +292,7 @@ HPBUFFERARB WINAPI wglCreatePbufferARB( HDC hdc, int format, int width, int heig return ret; }
-BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle ) +static BOOL wrap_wglDestroyPbufferARB( HPBUFFERARB handle ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER );
@@ -304,7 +302,7 @@ BOOL WINAPI wglDestroyPbufferARB( HPBUFFERARB handle ) return TRUE; }
-HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle ) +static HDC wrap_wglGetPbufferDCARB( HPBUFFERARB handle ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); HDC ret; @@ -315,7 +313,7 @@ HDC WINAPI wglGetPbufferDCARB( HPBUFFERARB handle ) return ret; }
-BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) +static BOOL wrap_wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) { BOOL ret = TRUE; struct wgl_handle *ptr, *prev = get_current_context_ptr(); @@ -354,7 +352,7 @@ BOOL WINAPI wglMakeContextCurrentARB( HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) return ret; }
-BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value ) +static BOOL wrap_wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); BOOL ret; @@ -365,7 +363,7 @@ BOOL WINAPI wglQueryPbufferARB( HPBUFFERARB handle, int attrib, int *value ) return ret; }
-int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc ) +static int wrap_wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); BOOL ret; @@ -376,7 +374,7 @@ int WINAPI wglReleasePbufferDCARB( HPBUFFERARB handle, HDC hdc ) return ret; }
-BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer ) +static BOOL wrap_wglReleaseTexImageARB( HPBUFFERARB handle, int buffer ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); BOOL ret; @@ -387,7 +385,7 @@ BOOL WINAPI wglReleaseTexImageARB( HPBUFFERARB handle, int buffer ) return ret; }
-BOOL WINAPI wglSetPbufferAttribARB( HPBUFFERARB handle, const int *attribs ) +static BOOL wrap_wglSetPbufferAttribARB( HPBUFFERARB handle, const int *attribs ) { struct wgl_handle *ptr = get_handle_ptr( handle, HANDLE_PBUFFER ); BOOL ret; @@ -422,38 +420,162 @@ static void gl_debug_message_callback( GLenum source, GLenum type, GLuint id, GL callback( ¶ms, sizeof(params) ); }
-void WINAPI glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) +static void WINAPI wrap_glDebugMessageCallback( GLDEBUGPROC callback, const void *userParam ) { struct wgl_handle *ptr = get_current_context_ptr(); const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
- TRACE( "(%p, %p)\n", callback, userParam ); + if (!funcs->ext.p_glDebugMessageCallback) return;
ptr->u.context->debug_callback = callback; ptr->u.context->debug_user = userParam; funcs->ext.p_glDebugMessageCallback( gl_debug_message_callback, ptr ); }
-void WINAPI glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) +static void WINAPI wrap_glDebugMessageCallbackAMD( GLDEBUGPROCAMD callback, void *userParam ) { struct wgl_handle *ptr = get_current_context_ptr(); const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
- TRACE( "(%p, %p)\n", callback, userParam ); + if (!funcs->ext.p_glDebugMessageCallbackAMD) return;
ptr->u.context->debug_callback = callback; ptr->u.context->debug_user = userParam; funcs->ext.p_glDebugMessageCallbackAMD( gl_debug_message_callback, ptr ); }
-void WINAPI glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) +static void WINAPI wrap_glDebugMessageCallbackARB( GLDEBUGPROCARB callback, const void *userParam ) { struct wgl_handle *ptr = get_current_context_ptr(); const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
- TRACE( "(%p, %p)\n", callback, userParam ); + if (!funcs->ext.p_glDebugMessageCallbackARB) return;
ptr->u.context->debug_callback = callback; ptr->u.context->debug_user = userParam; funcs->ext.p_glDebugMessageCallbackARB( gl_debug_message_callback, ptr ); } + +NTSTATUS wgl_wglCopyContext( void *args ) +{ + struct wglCopyContext_params *params = args; + params->ret = wrap_wglCopyContext( params->hglrcSrc, params->hglrcDst, params->mask ); + return STATUS_SUCCESS; +} + +NTSTATUS wgl_wglCreateContext( void *args ) +{ + struct wglCreateContext_params *params = args; + params->ret = wrap_wglCreateContext( params->hDc ); + return STATUS_SUCCESS; +} + +NTSTATUS wgl_wglDeleteContext( void *args ) +{ + struct wglDeleteContext_params *params = args; + params->ret = wrap_wglDeleteContext( params->oldContext ); + return STATUS_SUCCESS; +} + +NTSTATUS wgl_wglMakeCurrent( void *args ) +{ + struct wglMakeCurrent_params *params = args; + params->ret = wrap_wglMakeCurrent( params->hDc, params->newContext ); + return STATUS_SUCCESS; +} + +NTSTATUS wgl_wglShareLists( void *args ) +{ + struct wglShareLists_params *params = args; + params->ret = wrap_wglShareLists( params->hrcSrvShare, params->hrcSrvSource ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_glDebugMessageCallback( void *args ) +{ + struct glDebugMessageCallback_params *params = args; + wrap_glDebugMessageCallback( params->callback, params->userParam ); + return STATUS_SUCCESS; +} +NTSTATUS ext_glDebugMessageCallbackAMD( void *args ) +{ + struct glDebugMessageCallbackAMD_params *params = args; + wrap_glDebugMessageCallbackAMD( params->callback, params->userParam ); + return STATUS_SUCCESS; +} +NTSTATUS ext_glDebugMessageCallbackARB( void *args ) +{ + struct glDebugMessageCallbackARB_params *params = args; + wrap_glDebugMessageCallbackARB( params->callback, params->userParam ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglBindTexImageARB( void *args ) +{ + struct wglBindTexImageARB_params *params = args; + params->ret = wrap_wglBindTexImageARB( params->hPbuffer, params->iBuffer ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglCreateContextAttribsARB( void *args ) +{ + struct wglCreateContextAttribsARB_params *params = args; + params->ret = wrap_wglCreateContextAttribsARB( params->hDC, params->hShareContext, params->attribList ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglCreatePbufferARB( void *args ) +{ + struct wglCreatePbufferARB_params *params = args; + params->ret = wrap_wglCreatePbufferARB( params->hDC, params->iPixelFormat, params->iWidth, params->iHeight, params->piAttribList ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglDestroyPbufferARB( void *args ) +{ + struct wglDestroyPbufferARB_params *params = args; + params->ret = wrap_wglDestroyPbufferARB( params->hPbuffer ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglGetPbufferDCARB( void *args ) +{ + struct wglGetPbufferDCARB_params *params = args; + params->ret = wrap_wglGetPbufferDCARB( params->hPbuffer ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglMakeContextCurrentARB( void *args ) +{ + struct wglMakeContextCurrentARB_params *params = args; + params->ret = wrap_wglMakeContextCurrentARB( params->hDrawDC, params->hReadDC, params->hglrc ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglQueryPbufferARB( void *args ) +{ + struct wglQueryPbufferARB_params *params = args; + params->ret = wrap_wglQueryPbufferARB( params->hPbuffer, params->iAttribute, params->piValue ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglReleasePbufferDCARB( void *args ) +{ + struct wglReleasePbufferDCARB_params *params = args; + params->ret = wrap_wglReleasePbufferDCARB( params->hPbuffer, params->hDC ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglReleaseTexImageARB( void *args ) +{ + struct wglReleaseTexImageARB_params *params = args; + params->ret = wrap_wglReleaseTexImageARB( params->hPbuffer, params->iBuffer ); + return STATUS_SUCCESS; +} + +NTSTATUS ext_wglSetPbufferAttribARB( void *args ) +{ + struct wglSetPbufferAttribARB_params *params = args; + params->ret = wrap_wglSetPbufferAttribARB( params->hPbuffer, params->piAttribList ); + return STATUS_SUCCESS; +}