summaryrefslogtreecommitdiff
path: root/src/glx/apple/include/GL/gl.h.template
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2010-04-01 11:01:31 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2010-04-27 11:26:50 -0700
commitad503c41557606d15b0420c824369456f6d20a8f (patch)
tree7155272412f9b20b559fa172a1718fd8dfe6e98a /src/glx/apple/include/GL/gl.h.template
parentf1381880a8e0e0cdd96c4c725ff35a28b250b09d (diff)
apple: Initial import of libGL for OSX from AppleSGLX svn repository.
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'src/glx/apple/include/GL/gl.h.template')
-rw-r--r--src/glx/apple/include/GL/gl.h.template130
1 files changed, 130 insertions, 0 deletions
diff --git a/src/glx/apple/include/GL/gl.h.template b/src/glx/apple/include/GL/gl.h.template
new file mode 100644
index 0000000000..72169f98c3
--- /dev/null
+++ b/src/glx/apple/include/GL/gl.h.template
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __X_GL_H
+#define __X_GL_H
+
+/* The following macros exist to address conflicts between the names given to
+ * function pointers by the MESA API and OpenGL.framework's API.
+ */
+@CGL_MESA_COMPAT_MACROS@
+
+/* On SL, we want to use OpelGL.framework's headers to get both prototypes and
+ * function pointers (like Mesa's API), but on Leo and before, OpenGL.framework
+ * can't give us both.
+ */
+
+#ifdef GL_GLEXT_FUNCTION_POINTERS
+#define _GL_GLEXT_FUNCTION_POINTERS GL_GLEXT_FUNCTION_POINTERS
+#undef GL_GLEXT_FUNCTION_POINTERS
+#endif
+
+#ifdef GL_GLEXT_PROTOTYPES
+#define _GL_GLEXT_PROTOTYPES GL_GLEXT_PROTOTYPES
+#else
+#define GL_GLEXT_PROTOTYPES 1
+#endif
+
+/* Our glext.h is based on a version from the registry that is newer. */
+#ifdef GL_GLEXT_LEGACY
+#define _GL_GLEXT_LEGACY GL_GLEXT_LEGACY
+#else
+#define GL_GLEXT_LEGACY 1
+#endif
+
+#include "/System/Library/Frameworks/OpenGL.framework/Headers/gl.h"
+
+/* These are not set by the system gl.h */
+#define GL_VERSION_1_2_DEPRECATED 1
+#define GL_VERSION_1_3_DEPRECATED 1
+#define GL_VERSION_1_4_DEPRECATED 1
+
+/* Restore our GLEXT-fu */
+#ifdef _GL_GLEXT_FUNCTION_POINTERS
+#define GL_GLEXT_FUNCTION_POINTERS _GL_GLEXT_FUNCTION_POINTERS
+#undef _GL_GLEXT_FUNCTION_POINTERS
+#endif
+
+#ifdef _GL_GLEXT_PROTOTYPES
+#undef _GL_GLEXT_PROTOTYPES
+#else
+#undef GL_GLEXT_PROTOTYPES
+#endif
+
+#ifdef _GL_GLEXT_LEGACY
+#undef _GL_GLEXT_LEGACY
+#else
+#undef GL_GLEXT_LEGACY
+#endif
+
+@CGL_MESA_FUNCTION_POINTERS@
+
+#ifndef GL_GLEXT_LEGACY
+#include <GL/glext.h>
+#endif
+
+/*
+ * This is needed for building apple_glx_pbuffer.c, the latest
+ * glext.h from the registry lacks it, so it's from the Leopard glext.h:
+ */
+#ifndef GL_TEXTURE_RECTANGLE_EXT
+#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
+#endif
+
+/* This is needed for building the X server: */
+/*
+ * GL_MESA_packed_depth_stencil
+ */
+#ifndef GL_MESA_packed_depth_stencil
+#define GL_MESA_packed_depth_stencil 1
+
+#define GL_DEPTH_STENCIL_MESA 0x8750
+#define GL_UNSIGNED_INT_24_8_MESA 0x8751
+#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
+#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
+#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
+
+#endif /* GL_MESA_packed_depth_stencil */
+
+/* Various other OS projects expect to get these macros from Mesa's gl.h */
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY GLAPIENTRY
+#endif
+
+/* "P" suffix to be used for a pointer to a function */
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP GLAPIENTRY *
+#endif
+
+#endif /*__X_GL_H*/