1
mirror of https://github.com/mpv-player/mpv synced 2024-09-12 23:45:53 +02:00

gl_common: allow compilation on Mac OS 10.6

Define just enough constants to allow compilation on OS X Snow Leopard.
mpv's OpenGL autodetection features should make the rest.
This commit is contained in:
Stefano Pigozzi 2012-10-07 19:22:18 +02:00
parent abc0ab8f61
commit db984edf24
2 changed files with 18 additions and 1 deletions

View File

@ -34,8 +34,11 @@
#include "csputils.h"
#if defined(CONFIG_GL_COCOA) && !defined(CONFIG_GL_X11)
#include <OpenGL/gl.h>
#ifdef GL_VERSION_3_0
#include <OpenGL/gl3.h>
#else
#include <OpenGL/gl.h>
#endif
#include <OpenGL/glext.h>
#else
#include <GL/gl.h>

View File

@ -229,3 +229,17 @@
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#endif
// Define just enough constants to make the OpenGL 3 code compile against
// older SDKs. Values are taken straight from OpenGL/gl3.h
#if defined __APPLE__ && !(defined GL_VERSION_3_0)
#define GL_RGBA16F 0x881A
#define GL_RGB16F 0x881B
#define GL_MAJOR_VERSION 0x821B
#define GL_MINOR_VERSION 0x821C
#define GL_NUM_EXTENSIONS 0x821D
#ifndef GL_ARB_framebuffer_sRGB
#define GL_FRAMEBUFFER_SRGB 0x8DB9
#endif
#endif