summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-04-07 14:30:51 +0200
committerwm4 <wm4@nowhere>2017-04-07 15:09:27 +0200
commiteb83ee4a4a03269ac6de296c9a1c01f68bb2e835 (patch)
tree65507b0aa83e705c8d6a6e661a1f4a843596466d /wscript
parentb7b12c36af96af14b8371d16c5a7f98a7a17915f (diff)
downloadmpv-eb83ee4a4a03269ac6de296c9a1c01f68bb2e835.tar.bz2
mpv-eb83ee4a4a03269ac6de296c9a1c01f68bb2e835.tar.xz
vo_opengl: add our own copy of OpenGL headers
gl_headers.h is basically header_fixes.h done consequently. It contains all OpenGL defines (and some typedefs) we need. We don't include GL headers provided by the system anymore. Some care has to be taken by certain windowing APIs including all of gl.h anyway. Then the definitions could clash. Fortunately, redefining preprocessor symbols to the same content is allowed and ignored. Also, redefining typedefs to the same thing is allowed in C11. Apparently the latter is not allowed in C99, so there is an imperfect attempt to avoid the typedefs if required API symbols are apparently present already. The nost risky part about this are the standard typedefs and GLAPIENTRY. The latter is different only on win32 (and at least consistently so). The typedefs are mostly based on stdint.h typedefs, which khrplatform.h clumsily emulates on platforms which don't have it. The biggest difference is that we define GLsizeiptr directly to ptrdiff_t, instead of checking for the _WIN64 symbol and defining it to long or long long. This also typedefs GLsync to __GLsync, just like the khronos headers. Although symbols prefixed with __ are implementation reserved, khronos also violates this rule, and having the same definition as khronos will avoid problems on duplicate definitions. We can simplify the build scripts too. The ios-gl check seems a bit wrong now (what we really want to test for is EAGLContext), but I can't test and thus can't improve it. cuda_dynamic.h redefined two GL symbols; just include the new headers directly instead.
Diffstat (limited to 'wscript')
-rw-r--r--wscript20
1 files changed, 2 insertions, 18 deletions
diff --git a/wscript b/wscript
index 02b5a54cff..0fe452962e 100644
--- a/wscript
+++ b/wscript
@@ -744,35 +744,19 @@ video_output_features = [
'name': '--rpi',
'desc': 'Raspberry Pi support',
'func': check_rpi,
- }, {
- 'name': '--standard-gl',
- 'desc': 'Desktop standard OpenGL support',
- # arbitrary OpenGL 3.0 symbol, and an arbitrary OpenGL legacy-only symbol
- 'func': check_statement('GL/gl.h', '(void)GL_RGB32F; (void)GL_LUMINANCE16'),
- } , {
- 'name': '--standard-gles3',
- 'desc': 'Standard OpenGL ES 3.0 support',
- 'deps_neg': [ 'standard-gl' ],
- 'func': check_statement('GLES3/gl3.h', '(void)GL_RGB32F'), # arbitrary OpenGL ES 3.0 symbol
} , {
'name': '--ios-gl',
- 'desc': 'iOS OpenGL ES support',
+ 'desc': 'iOS OpenGL ES hardware decoding interop support',
'func': check_statement('OpenGLES/ES3/glext.h', '(void)GL_RGB32F'), # arbitrary OpenGL ES 3.0 symbol
} , {
- 'name': '--any-gl',
- 'desc': 'Any OpenGL (ES) support',
- 'deps_any': ['standard-gl', 'standard-gles3', 'ios-gl', 'cocoa'],
- 'func': check_true
- } , {
'name': '--plain-gl',
'desc': 'OpenGL without platform-specific code (e.g. for libmpv)',
- 'deps': ['any-gl'],
'deps_any': [ 'libmpv-shared', 'libmpv-static' ],
'func': check_true,
}, {
'name': '--mali-fbdev',
'desc': 'MALI via Linux fbdev',
- 'deps': ['standard-gl', 'libdl'],
+ 'deps': ['libdl'],
'func': compose_checks(
check_cc(lib="EGL"),
check_cc(lib="GLESv2"),