From: Alexandros Frantzis alexandros.frantzis@collabora.com
--- dlls/opengl32/make_opengl | 1 + dlls/opengl32/unix_thunks.c | 10 +----- dlls/opengl32/unix_wgl.c | 65 +++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 9 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index f3f669ddf93..e17b7aedc36 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -194,6 +194,7 @@ my %manual_unix_functions = "glGetStringi" => 1, "glGetIntegerv" => 1, "wglGetPixelFormatAttribivARB" => 1, + "wglGetPixelFormatAttribfvARB" => 1, "wglGetProcAddress" => 1, ); my %manual_wow64_thunks = diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index b8898d19d4e..eae1697617b 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -41,6 +41,7 @@ extern NTSTATUS ext_wglCreateContextAttribsARB( void *args ); extern NTSTATUS ext_wglCreatePbufferARB( void *args ); extern NTSTATUS ext_wglDestroyPbufferARB( void *args ); extern NTSTATUS ext_wglGetPbufferDCARB( void *args ); +extern NTSTATUS ext_wglGetPixelFormatAttribfvARB( void *args ); extern NTSTATUS ext_wglGetPixelFormatAttribivARB( void *args ); extern NTSTATUS ext_wglMakeContextCurrentARB( void *args ); extern NTSTATUS ext_wglQueryPbufferARB( void *args ); @@ -24126,15 +24127,6 @@ NTSTATUS ext_wglGetExtensionsStringEXT( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_wglGetPixelFormatAttribfvARB( void *args ) -{ - struct wglGetPixelFormatAttribfvARB_params *params = args; - const struct opengl_funcs *funcs = get_dc_funcs( params->hdc ); - if (!funcs || !funcs->ext.p_wglGetPixelFormatAttribfvARB) return STATUS_NOT_IMPLEMENTED; - params->ret = funcs->ext.p_wglGetPixelFormatAttribfvARB( params->hdc, params->iPixelFormat, params->iLayerPlane, params->nAttributes, params->piAttributes, params->pfValues ); - return STATUS_SUCCESS; -} - static NTSTATUS ext_wglGetSwapIntervalEXT( void *args ) { struct wglGetSwapIntervalEXT_params *params = args; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index eaafc7102cf..4fc7eab18a8 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -992,6 +992,42 @@ static BOOL wrap_wglGetPixelFormatAttribivARB( HDC hdc, int iPixelFormat, int iL return TRUE; }
+static BOOL wrap_wglGetPixelFormatAttribfvARB( HDC hdc, int iPixelFormat, int iLayerPlane, + UINT nAttributes, const int *pfAttributes, FLOAT *pfValues ) +{ + const struct opengl_funcs *funcs = get_dc_funcs( hdc ); + const struct wgl_pixel_format *formats, *format; + UINT num_formats; + UINT i; + + TRACE( "(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, pfAttributes, pfValues ); + + num_formats = funcs->wgl.p_get_pixel_formats( &formats ); + + if (iPixelFormat > 0 && iPixelFormat - 1 < num_formats) + format = &formats[iPixelFormat - 1]; + else + format = NULL; + + for (i = 0; i < nAttributes; ++i) + { + int attrib = pfAttributes[i]; + switch (attrib) + { + case WGL_NUMBER_PIXEL_FORMATS_ARB: + pfValues[i] = num_formats; + break; + default: + if (format && (iLayerPlane == 0 || !wgl_attrib_uses_layer( attrib ))) + pfValues[i] = wgl_pixel_format_get_attrib( format, attrib ); + else + return FALSE; + } + } + + return TRUE; +} + static BOOL wrap_wglMakeContextCurrentARB( TEB *teb, HDC draw_hdc, HDC read_hdc, HGLRC hglrc ) { BOOL ret = TRUE; @@ -1293,6 +1329,35 @@ NTSTATUS ext_wglGetPixelFormatAttribivARB( void *args ) return STATUS_SUCCESS; }
+NTSTATUS ext_wglGetPixelFormatAttribfvARB( void *args ) +{ + struct wglGetPixelFormatAttribfvARB_params *params = args; + const struct opengl_funcs *funcs = get_dc_funcs( params->hdc ); + + if (!funcs) return STATUS_NOT_IMPLEMENTED; + + if (funcs->ext.p_wglGetPixelFormatAttribfvARB && + funcs->ext.p_wglGetPixelFormatAttribfvARB != (void *)1) + { + params->ret = + funcs->ext.p_wglGetPixelFormatAttribfvARB( params->hdc, params->iPixelFormat, + params->iLayerPlane, params->nAttributes, + params->piAttributes, params->pfValues ); + } + else if (funcs->wgl.p_get_pixel_formats) + { + params->ret = wrap_wglGetPixelFormatAttribfvARB( params->hdc, params->iPixelFormat, + params->iLayerPlane, params->nAttributes, + params->piAttributes, params->pfValues ); + } + else + { + return STATUS_NOT_IMPLEMENTED; + } + + return STATUS_SUCCESS; +} + NTSTATUS ext_wglMakeContextCurrentARB( void *args ) { struct wglMakeContextCurrentARB_params *params = args;