Commit 39819d1e authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Replace wgl.h by the official wglext.h from the OpenGL registry.

parent 19fcc230
...@@ -36,6 +36,14 @@ ...@@ -36,6 +36,14 @@
#ifdef HAVE_SYS_UN_H #ifdef HAVE_SYS_UN_H
#include <sys/un.h> #include <sys/un.h>
#endif #endif
#ifdef HAVE_GL_GL_H
# include <GL/gl.h>
#endif
#ifdef HAVE_GL_GLX_H
# include <GL/glx.h>
#endif
#undef APIENTRY
#undef GLAPI
#include "x11drv.h" #include "x11drv.h"
#include "winternl.h" #include "winternl.h"
...@@ -49,27 +57,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl); ...@@ -49,27 +57,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wgl);
WINE_DECLARE_DEBUG_CHANNEL(winediag); WINE_DECLARE_DEBUG_CHANNEL(winediag);
WINE_DECLARE_DEBUG_CHANNEL(fps); WINE_DECLARE_DEBUG_CHANNEL(fps);
#undef APIENTRY #include "wine/wglext.h"
#undef CALLBACK
#undef WINAPI
#ifdef HAVE_GL_GL_H
# include <GL/gl.h>
#endif
#ifdef HAVE_GL_GLX_H
# include <GL/glx.h>
#endif
#undef APIENTRY
#undef CALLBACK
#undef WINAPI
/* Redefines the constants */
#define CALLBACK __stdcall
#define WINAPI __stdcall
#define APIENTRY WINAPI
#include "wine/wgl.h"
/* For compatibility with old Mesa headers */ /* For compatibility with old Mesa headers */
#ifndef GLX_SAMPLE_BUFFERS_ARB #ifndef GLX_SAMPLE_BUFFERS_ARB
...@@ -3056,7 +3044,7 @@ static const WineGLExtension WGL_internal_functions = ...@@ -3056,7 +3044,7 @@ static const WineGLExtension WGL_internal_functions =
}; };
static const WineGLExtension WGL_ARB_create_context = static const WineGLExtension WGL_ARB_create_context_extension =
{ {
"WGL_ARB_create_context", "WGL_ARB_create_context",
{ {
...@@ -3064,7 +3052,7 @@ static const WineGLExtension WGL_ARB_create_context = ...@@ -3064,7 +3052,7 @@ static const WineGLExtension WGL_ARB_create_context =
} }
}; };
static const WineGLExtension WGL_ARB_extensions_string = static const WineGLExtension WGL_ARB_extensions_string_extension =
{ {
"WGL_ARB_extensions_string", "WGL_ARB_extensions_string",
{ {
...@@ -3072,7 +3060,7 @@ static const WineGLExtension WGL_ARB_extensions_string = ...@@ -3072,7 +3060,7 @@ static const WineGLExtension WGL_ARB_extensions_string =
} }
}; };
static const WineGLExtension WGL_ARB_make_current_read = static const WineGLExtension WGL_ARB_make_current_read_extension =
{ {
"WGL_ARB_make_current_read", "WGL_ARB_make_current_read",
{ {
...@@ -3081,12 +3069,12 @@ static const WineGLExtension WGL_ARB_make_current_read = ...@@ -3081,12 +3069,12 @@ static const WineGLExtension WGL_ARB_make_current_read =
} }
}; };
static const WineGLExtension WGL_ARB_multisample = static const WineGLExtension WGL_ARB_multisample_extension =
{ {
"WGL_ARB_multisample", "WGL_ARB_multisample",
}; };
static const WineGLExtension WGL_ARB_pbuffer = static const WineGLExtension WGL_ARB_pbuffer_extension =
{ {
"WGL_ARB_pbuffer", "WGL_ARB_pbuffer",
{ {
...@@ -3099,7 +3087,7 @@ static const WineGLExtension WGL_ARB_pbuffer = ...@@ -3099,7 +3087,7 @@ static const WineGLExtension WGL_ARB_pbuffer =
} }
}; };
static const WineGLExtension WGL_ARB_pixel_format = static const WineGLExtension WGL_ARB_pixel_format_extension =
{ {
"WGL_ARB_pixel_format", "WGL_ARB_pixel_format",
{ {
...@@ -3109,7 +3097,7 @@ static const WineGLExtension WGL_ARB_pixel_format = ...@@ -3109,7 +3097,7 @@ static const WineGLExtension WGL_ARB_pixel_format =
} }
}; };
static const WineGLExtension WGL_ARB_render_texture = static const WineGLExtension WGL_ARB_render_texture_extension =
{ {
"WGL_ARB_render_texture", "WGL_ARB_render_texture",
{ {
...@@ -3118,7 +3106,7 @@ static const WineGLExtension WGL_ARB_render_texture = ...@@ -3118,7 +3106,7 @@ static const WineGLExtension WGL_ARB_render_texture =
} }
}; };
static const WineGLExtension WGL_EXT_extensions_string = static const WineGLExtension WGL_EXT_extensions_string_extension =
{ {
"WGL_EXT_extensions_string", "WGL_EXT_extensions_string",
{ {
...@@ -3126,7 +3114,7 @@ static const WineGLExtension WGL_EXT_extensions_string = ...@@ -3126,7 +3114,7 @@ static const WineGLExtension WGL_EXT_extensions_string =
} }
}; };
static const WineGLExtension WGL_EXT_swap_control = static const WineGLExtension WGL_EXT_swap_control_extension =
{ {
"WGL_EXT_swap_control", "WGL_EXT_swap_control",
{ {
...@@ -3135,7 +3123,7 @@ static const WineGLExtension WGL_EXT_swap_control = ...@@ -3135,7 +3123,7 @@ static const WineGLExtension WGL_EXT_swap_control =
} }
}; };
static const WineGLExtension WGL_NV_vertex_array_range = static const WineGLExtension WGL_NV_vertex_array_range_extension =
{ {
"WGL_NV_vertex_array_range", "WGL_NV_vertex_array_range",
{ {
...@@ -3144,7 +3132,7 @@ static const WineGLExtension WGL_NV_vertex_array_range = ...@@ -3144,7 +3132,7 @@ static const WineGLExtension WGL_NV_vertex_array_range =
} }
}; };
static const WineGLExtension WGL_WINE_pixel_format_passthrough = static const WineGLExtension WGL_WINE_pixel_format_passthrough_extension =
{ {
"WGL_WINE_pixel_format_passthrough", "WGL_WINE_pixel_format_passthrough",
{ {
...@@ -3166,7 +3154,7 @@ static void X11DRV_WineGL_LoadExtensions(void) ...@@ -3166,7 +3154,7 @@ static void X11DRV_WineGL_LoadExtensions(void)
if(glxRequireExtension("GLX_ARB_create_context")) if(glxRequireExtension("GLX_ARB_create_context"))
{ {
register_extension(&WGL_ARB_create_context); register_extension(&WGL_ARB_create_context_extension);
if(glxRequireExtension("GLX_ARB_create_context_profile")) if(glxRequireExtension("GLX_ARB_create_context_profile"))
register_extension_string("WGL_ARB_create_context_profile"); register_extension_string("WGL_ARB_create_context_profile");
...@@ -3178,27 +3166,27 @@ static void X11DRV_WineGL_LoadExtensions(void) ...@@ -3178,27 +3166,27 @@ static void X11DRV_WineGL_LoadExtensions(void)
register_extension_string("WGL_ATI_pixel_format_float"); register_extension_string("WGL_ATI_pixel_format_float");
} }
register_extension(&WGL_ARB_extensions_string); register_extension(&WGL_ARB_extensions_string_extension);
if (glxRequireVersion(3)) if (glxRequireVersion(3))
register_extension(&WGL_ARB_make_current_read); register_extension(&WGL_ARB_make_current_read_extension);
if (glxRequireExtension("GLX_ARB_multisample")) if (glxRequireExtension("GLX_ARB_multisample"))
register_extension(&WGL_ARB_multisample); register_extension(&WGL_ARB_multisample_extension);
/* In general pbuffer functionality requires support in the X-server. The functionality is /* In general pbuffer functionality requires support in the X-server. The functionality is
* available either when the GLX_SGIX_pbuffer is present or when the GLX server version is 1.3. * available either when the GLX_SGIX_pbuffer is present or when the GLX server version is 1.3.
*/ */
if ( glxRequireVersion(3) && glxRequireExtension("GLX_SGIX_pbuffer") ) if ( glxRequireVersion(3) && glxRequireExtension("GLX_SGIX_pbuffer") )
register_extension(&WGL_ARB_pbuffer); register_extension(&WGL_ARB_pbuffer_extension);
register_extension(&WGL_ARB_pixel_format); register_extension(&WGL_ARB_pixel_format_extension);
/* Support WGL_ARB_render_texture when there's support or pbuffer based emulation */ /* Support WGL_ARB_render_texture when there's support or pbuffer based emulation */
if (glxRequireExtension("GLX_ARB_render_texture") || if (glxRequireExtension("GLX_ARB_render_texture") ||
(glxRequireVersion(3) && glxRequireExtension("GLX_SGIX_pbuffer") && use_render_texture_emulation)) (glxRequireVersion(3) && glxRequireExtension("GLX_SGIX_pbuffer") && use_render_texture_emulation))
{ {
register_extension(&WGL_ARB_render_texture); register_extension(&WGL_ARB_render_texture_extension);
/* The WGL version of GLX_NV_float_buffer requires render_texture */ /* The WGL version of GLX_NV_float_buffer requires render_texture */
if(glxRequireExtension("GLX_NV_float_buffer")) if(glxRequireExtension("GLX_NV_float_buffer"))
...@@ -3211,11 +3199,11 @@ static void X11DRV_WineGL_LoadExtensions(void) ...@@ -3211,11 +3199,11 @@ static void X11DRV_WineGL_LoadExtensions(void)
/* EXT Extensions */ /* EXT Extensions */
register_extension(&WGL_EXT_extensions_string); register_extension(&WGL_EXT_extensions_string_extension);
/* Load this extension even when it isn't backed by a GLX extension because it is has been around for ages. /* Load this extension even when it isn't backed by a GLX extension because it is has been around for ages.
* Games like Call of Duty and K.O.T.O.R. rely on it. Further our emulation is good enough. */ * Games like Call of Duty and K.O.T.O.R. rely on it. Further our emulation is good enough. */
register_extension(&WGL_EXT_swap_control); register_extension(&WGL_EXT_swap_control_extension);
if(glxRequireExtension("GLX_EXT_framebuffer_sRGB")) if(glxRequireExtension("GLX_EXT_framebuffer_sRGB"))
register_extension_string("WGL_EXT_framebuffer_sRGB"); register_extension_string("WGL_EXT_framebuffer_sRGB");
...@@ -3228,14 +3216,14 @@ static void X11DRV_WineGL_LoadExtensions(void) ...@@ -3228,14 +3216,14 @@ static void X11DRV_WineGL_LoadExtensions(void)
/* The OpenGL extension GL_NV_vertex_array_range adds wgl/glX functions which aren't exported as 'real' wgl/glX extensions. */ /* 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) if(strstr(WineGLInfo.glExtensions, "GL_NV_vertex_array_range") != NULL)
register_extension(&WGL_NV_vertex_array_range); register_extension(&WGL_NV_vertex_array_range_extension);
/* WINE-specific WGL Extensions */ /* WINE-specific WGL Extensions */
/* In WineD3D we need the ability to set the pixel format more than once (e.g. after a device reset). /* In WineD3D we need the ability to set the pixel format more than once (e.g. after a device reset).
* The default wglSetPixelFormat doesn't allow this, so add our own which allows it. * The default wglSetPixelFormat doesn't allow this, so add our own which allows it.
*/ */
register_extension(&WGL_WINE_pixel_format_passthrough); register_extension(&WGL_WINE_pixel_format_passthrough_extension);
} }
......
/*
* Wine WGL extension + ATI GLX extension defines
*
* Copyright (c) 2004 Lionel Ulmer
* Copyright (c) 2005 Alex Woods
* Copyright (c) 2005 Raphael Junqueira
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
DECLARE_HANDLE(HPBUFFERARB);
DECLARE_HANDLE(HPBUFFEREXT);
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_STEREO_ARB 0x2012
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
/**
* WGL_render_texture
*/
/** GetPixelFormat/ChoosePixelFormat */
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
/** CreatePbuffer / QueryPbuffer */
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
/** CreatePbuffer / QueryPbuffer */
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_NO_TEXTURE_ARB 0x2077
/** CreatePbuffer / QueryPbuffer */
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_NO_TEXTURE_ARB 0x2077
/** SetPbufferAttribARB/QueryPbufferARB parameters */
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_CUBE_MAP_FACE_ARB 0x207C
/** SetPbufferAttribARB/QueryPbufferARB attribs */
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
/** BindTexImageARB/ReleaseTexImageARB */
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
/** WGL_NV_render_texture_rectangle */
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
/** WGL_NV_render_depth_texture */
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
#define WGL_DEPTH_COMPONENT_NV 0x20A7
/** WGL_NV_float_buffer */
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
/** WGL_EXT_framebuffer_sRGB */
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
/* WGL_EXT_pixel_format_packed_float */
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
/** WGL_ARB_create_context */
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define ERROR_INVALID_VERSION_ARB 0x2095
#define ERROR_INVALID_PROFILE_ARB 0x2096
/**
* WGL_ATI_pixel_format_float / WGL_ARB_color_buffer_float
*/
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment