mirror of
https://github.com/mpv-player/mpv
synced 2024-11-14 22:48:35 +01:00
eb83ee4a4a
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. |
||
---|---|---|
.. | ||
angle_dynamic.c | ||
angle_dynamic.h | ||
common.c | ||
common.h | ||
context_angle.c | ||
context_cocoa.c | ||
context_drm_egl.c | ||
context_dxinterop.c | ||
context_mali_fbdev.c | ||
context_rpi.c | ||
context_vdpau.c | ||
context_w32.c | ||
context_wayland.c | ||
context_x11.c | ||
context_x11egl.c | ||
context.c | ||
context.h | ||
cuda_dynamic.c | ||
cuda_dynamic.h | ||
egl_helpers.c | ||
egl_helpers.h | ||
formats.c | ||
formats.h | ||
gl_headers.h | ||
hwdec_cuda.c | ||
hwdec_d3d11egl.c | ||
hwdec_d3d11eglrgb.c | ||
hwdec_dxva2egl.c | ||
hwdec_dxva2gldx.c | ||
hwdec_ios.m | ||
hwdec_osx.c | ||
hwdec_rpi.c | ||
hwdec_vaegl.c | ||
hwdec_vaglx.c | ||
hwdec_vdpau.c | ||
hwdec.c | ||
hwdec.h | ||
lcms.c | ||
lcms.h | ||
osd.c | ||
osd.h | ||
user_shaders.c | ||
user_shaders.h | ||
utils.c | ||
utils.h | ||
video_shaders.c | ||
video_shaders.h | ||
video.c | ||
video.h |