summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvo/gl_common.h5
-rw-r--r--libvo/gl_header_fixes.h14
2 files changed, 18 insertions, 1 deletions
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index d2592b2f4f..7f9dc28083 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -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>
diff --git a/libvo/gl_header_fixes.h b/libvo/gl_header_fixes.h
index c6f260b289..ebdbbb35b4 100644
--- a/libvo/gl_header_fixes.h
+++ b/libvo/gl_header_fixes.h
@@ -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