2012-03-17 09:49:15 +00:00
|
|
|
/*
|
2015-04-13 07:36:54 +00:00
|
|
|
* This file is part of mpv.
|
2012-03-17 09:49:15 +00:00
|
|
|
*
|
2016-01-19 17:36:34 +00:00
|
|
|
* mpv 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.
|
2012-03-17 09:49:15 +00:00
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2012-03-17 09:49:15 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2016-01-19 17:36:34 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2012-03-17 09:49:15 +00:00
|
|
|
*
|
2016-01-19 17:36:34 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2012-03-17 09:49:15 +00:00
|
|
|
*/
|
|
|
|
|
2013-03-03 12:02:10 +00:00
|
|
|
#ifdef MP_GET_GL_WORKAROUNDS
|
|
|
|
|
2012-03-17 09:49:15 +00:00
|
|
|
// workaround for some gl.h headers
|
|
|
|
#ifndef GLAPIENTRY
|
|
|
|
#ifdef APIENTRY
|
|
|
|
#define GLAPIENTRY APIENTRY
|
2013-07-16 11:28:28 +00:00
|
|
|
#elif HAVE_GL_WIN32
|
2012-03-17 09:49:15 +00:00
|
|
|
#define GLAPIENTRY __stdcall
|
|
|
|
#else
|
|
|
|
#define GLAPIENTRY
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GL_TEXTURE_RECTANGLE
|
|
|
|
#define GL_TEXTURE_RECTANGLE 0x84F5
|
|
|
|
#endif
|
|
|
|
#ifndef GL_UNSIGNED_SHORT_8_8
|
|
|
|
#define GL_UNSIGNED_SHORT_8_8 0x85BA
|
|
|
|
#endif
|
|
|
|
#ifndef GL_UNSIGNED_SHORT_8_8_REV
|
|
|
|
#define GL_UNSIGNED_SHORT_8_8_REV 0x85BB
|
|
|
|
#endif
|
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
#if HAVE_GL_WIN32 && !defined(WGL_CONTEXT_MAJOR_VERSION_ARB)
|
2012-03-17 09:49:15 +00:00
|
|
|
/* these are supposed to be defined in wingdi.h but mingw's is too old */
|
|
|
|
/* only the bits actually used by mplayer are defined */
|
|
|
|
/* reference: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt */
|
|
|
|
|
|
|
|
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
|
|
|
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
|
|
|
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
|
|
|
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
|
|
|
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
|
|
|
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
|
|
|
#endif
|
2012-10-07 17:22:18 +00:00
|
|
|
|
2013-11-05 21:39:19 +00:00
|
|
|
#ifndef GL_NV_vdpau_interop
|
2013-11-05 21:06:48 +00:00
|
|
|
#define GLvdpauSurfaceNV GLintptr
|
|
|
|
#endif
|
|
|
|
|
2014-12-23 02:12:37 +00:00
|
|
|
#ifndef GL_DEBUG_SEVERITY_HIGH
|
|
|
|
#define GL_DEBUG_SEVERITY_HIGH 0x9146
|
|
|
|
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
|
|
|
|
#define GL_DEBUG_SEVERITY_LOW 0x9148
|
|
|
|
#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
|
|
|
|
#endif
|
2014-12-17 21:17:11 +00:00
|
|
|
|
2016-02-08 21:06:51 +00:00
|
|
|
#if HAVE_ANDROID_GL
|
|
|
|
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
|
|
|
#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
|
|
|
|
#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
|
|
|
|
#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
|
|
|
|
#define GL_RGB_422_APPLE 0x8A1F
|
|
|
|
#define GL_BGR 0x80E0
|
|
|
|
#define GL_BGRA 0x80E1
|
|
|
|
#define GL_TEXTURE_1D 0x0DE0
|
|
|
|
#define GL_WRITE_ONLY 0x88B9
|
|
|
|
#define GL_RGB16 0x8054
|
|
|
|
#define GL_RGB10 0x8052
|
|
|
|
#define GL_RGBA12 0x805A
|
|
|
|
#define GL_RGBA16 0x805B
|
|
|
|
#define GL_TEXTURE_RED_SIZE 0x805C
|
|
|
|
#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
|
|
|
|
#define GL_R16 0x822A
|
|
|
|
#define GL_RG16 0x822C
|
2016-04-27 18:26:08 +00:00
|
|
|
#define GL_LUMINANCE8 0x8040
|
|
|
|
#define GL_LUMINANCE8_ALPHA8 0x8045
|
2016-02-08 21:06:51 +00:00
|
|
|
#define GL_LUMINANCE16 0x8042
|
|
|
|
#define GL_LUMINANCE16_ALPHA16 0x8048
|
|
|
|
#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
|
|
|
|
#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
|
|
|
|
#endif
|
|
|
|
|
2016-05-10 18:37:03 +00:00
|
|
|
// GL_OES_EGL_image_external, GL_NV_EGL_stream_consumer_external
|
|
|
|
#ifndef GL_TEXTURE_EXTERNAL_OES
|
|
|
|
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
|
|
|
|
#endif
|
|
|
|
|
2016-05-12 09:17:49 +00:00
|
|
|
// GL_ANGLE_translated_shader_source
|
|
|
|
#ifndef GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE
|
|
|
|
#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
|
|
|
|
#endif
|
|
|
|
|
2013-03-03 12:02:10 +00:00
|
|
|
#undef MP_GET_GL_WORKAROUNDS
|
|
|
|
|
2015-01-22 07:27:03 +00:00
|
|
|
#endif // MP_GET_GL_WORKAROUNDS
|
2013-03-03 12:02:10 +00:00
|
|
|
|
|
|
|
#ifdef MP_GET_GLX_WORKAROUNDS
|
|
|
|
|
2012-10-19 16:05:09 +00:00
|
|
|
// FreeBSD 10.0-CURRENT lacks the GLX_ARB_create_context extension completely
|
|
|
|
#ifndef GLX_CONTEXT_MAJOR_VERSION_ARB
|
|
|
|
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
|
|
|
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
|
|
|
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
|
|
|
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
|
2012-11-12 22:24:01 +00:00
|
|
|
#ifndef __APPLE__
|
|
|
|
// These are respectively 0x00000001 and 0x00000002 on OSX
|
2012-10-19 16:05:09 +00:00
|
|
|
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
|
|
|
|
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
2012-11-12 22:24:01 +00:00
|
|
|
#endif
|
2012-10-19 16:05:09 +00:00
|
|
|
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
|
|
|
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
|
|
|
#endif
|
2014-12-19 19:29:31 +00:00
|
|
|
// GLX_EXT_create_context_es2_profile
|
|
|
|
#ifndef GLX_CONTEXT_ES2_PROFILE_BIT_EXT
|
|
|
|
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
|
|
|
#endif
|
2013-03-03 12:02:10 +00:00
|
|
|
|
|
|
|
#undef MP_GET_GLX_WORKAROUNDS
|
|
|
|
|
|
|
|
#endif
|