opengl: Add WGL_EXT_pixel_format_packed_float support.

This commit is contained in:
Roderick Colenbrander 2009-04-20 22:57:19 +02:00 committed by Alexandre Julliard
parent 55ad3fdda2
commit 9b889626d0
2 changed files with 25 additions and 1 deletions

View File

@ -4,7 +4,7 @@
* Copyright 2000 Lionel Ulmer
* Copyright 2005 Alex Woods
* Copyright 2005 Raphael Junqueira
* Copyright 2006 Roderick Colenbrander
* Copyright 2006-2009 Roderick Colenbrander
* Copyright 2006 Tomas Carnecky
*
* This library is free software; you can redistribute it and/or
@ -681,6 +681,7 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
case WGL_TYPE_RGBA_ARB: pixelattrib = GLX_RGBA_BIT; break ;
/* This is the same as WGL_TYPE_RGBA_FLOAT_ATI but the GLX constants differ, only the ARB GLX one is widely supported so use that */
case WGL_TYPE_RGBA_FLOAT_ATI: pixelattrib = GLX_RGBA_FLOAT_BIT; break ;
case WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT: pixelattrib = GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT; break ;
default:
ERR("unexpected PixelType(%x)\n", pop);
pop = 0;
@ -790,6 +791,11 @@ static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, Wine_GLPBuf
TRACE("pAttr[%d] = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT: %x\n", cur, pop);
break ;
case WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT:
pop = iWGLAttr[++cur];
PUSH2(oGLXAttr, GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT, pop);
TRACE("pAttr[%d] = GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT: %x\n", cur, pop);
break ;
default:
FIXME("unsupported %x WGL Attribute\n", iWGLAttr[cur]);
break;
@ -839,6 +845,9 @@ static int get_render_type_from_fbconfig(Display *display, GLXFBConfig fbconfig)
case GLX_RGBA_FLOAT_BIT:
render_type = GLX_RGBA_FLOAT_TYPE;
break;
case GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT:
render_type = GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT;
break;
default:
ERR("Unknown render_type: %x\n", render_type);
}
@ -2743,6 +2752,7 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelF
else if (tmp & GLX_COLOR_INDEX_BIT) { piValues[i] = WGL_TYPE_COLORINDEX_ARB; }
else if (tmp & GLX_RGBA_FLOAT_BIT) { piValues[i] = WGL_TYPE_RGBA_FLOAT_ATI; }
else if (tmp & GLX_RGBA_FLOAT_ATI_BIT) { piValues[i] = WGL_TYPE_RGBA_FLOAT_ATI; }
else if (tmp & GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT) { piValues[i] = WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT; }
else {
ERR("unexpected RenderType(%x)\n", tmp);
piValues[i] = WGL_TYPE_RGBA_ARB;
@ -2853,6 +2863,10 @@ static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribivARB(HDC hdc, int iPixelF
curGLXAttr = GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT;
break;
case WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT:
curGLXAttr = GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT;
break;
case WGL_ACCUM_RED_BITS_ARB:
curGLXAttr = GLX_ACCUM_RED_SIZE;
break;
@ -3402,6 +3416,9 @@ static void X11DRV_WineGL_LoadExtensions(void)
if(glxRequireExtension("GLX_EXT_framebuffer_sRGB"))
register_extension_string("WGL_EXT_framebuffer_sRGB");
if(glxRequireExtension("GLX_EXT_fbconfig_packed_float"))
register_extension_string("WGL_EXT_pixel_format_packed_float");
/* The OpenGL extension GL_NV_vertex_array_range adds wgl/glX functions which aren't exported as 'real' wgl/glX extensions. */
if(strstr(WineGLInfo.glExtensions, "GL_NV_vertex_array_range") != NULL)
register_extension(&WGL_NV_vertex_array_range);

View File

@ -182,6 +182,13 @@
# define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
#endif
/* WGL_EXT_pixel_format_packed_float */
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
#ifndef GLX_EXT_fbconfig_packed_float
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
#endif
/** WGL_ARB_create_context */
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002