Chris Robinson : wgl: Implement wglGetPixelFormatAttribfvARB.
Module: wine Branch: master Commit: 34c40097a51509447c7078313421a38a8514dfc4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=34c40097a51509447c70783134... Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Dec 5 17:46:30 2006 -0800 wgl: Implement wglGetPixelFormatAttribfvARB. --- dlls/winex11.drv/opengl.c | 45 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 34 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 9178152..9d42019 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2228,17 +2228,6 @@ static GLboolean WINAPI X11DRV_wglChoose } /** - * X11DRV_wglGetPixelFormatAttribfvARB - * - * WGL_ARB_pixel_format: wglGetPixelFormatAttribfvARB - */ -static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues) -{ - FIXME("(%p, %d, %d, %d, %p, %p): stub\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); - return GL_FALSE; -} - -/** * X11DRV_wglGetPixelFormatAttribivARB * * WGL_ARB_pixel_format: wglGetPixelFormatAttribivARB @@ -2462,6 +2451,40 @@ pix_error: } /** + * X11DRV_wglGetPixelFormatAttribfvARB + * + * WGL_ARB_pixel_format: wglGetPixelFormatAttribfvARB + */ +static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues) +{ + int *attr; + int ret; + int i; + + TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); + + /* Allocate a temporary array to store integer values */ + attr = HeapAlloc(GetProcessHeap(), 0, nAttributes * sizeof(int)); + if (!attr) { + ERR("couldn't allocate %d array\n", nAttributes); + return GL_FALSE; + } + + /* Piggy-back on wglGetPixelFormatAttribivARB */ + ret = X11DRV_wglGetPixelFormatAttribivARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, attr); + if (ret) { + /* Convert integer values to float. Should also check for attributes + that can give decimal values here */ + for (i=0; i<nAttributes;i++) { + pfValues[i] = attr[i]; + } + } + + HeapFree(GetProcessHeap(), 0, attr); + return ret; +} + +/** * X11DRV_wglBindTexImageARB * * WGL_ARB_render_texture: wglBindTexImageARB
participants (1)
-
Alexandre Julliard