Merge branch 'radeon-rewrite' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa...
[mesa.git] / include / GL / gl.h
index d9c6e30eb24b760d6f4582ddd03c4d6656856da9..aad51214fbeae31ea795adc75c2746d8c2c7c416 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.2
+ * Version:  7.5
  *
- * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2006  Brian Paul   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"),
@@ -38,8 +38,6 @@
  */
 #if !defined(__SCITECH_SNAP__)
 
-#include <stddef.h>     /* to get ptrdiff_t, used below */
-
 #if defined(__BEOS__)
 #include <stdlib.h>     /* to get some BeOS-isms */
 #endif
 #  else /* for use with static link lib build of Win32 edition only */
 #    define GLAPI extern
 #  endif /* _STATIC_MESA support */
-#  define GLAPIENTRY __stdcall
+#  if defined(__MINGW32__) && defined(GL_NO_STDCALL) || defined(UNDER_CE)  /* The generated DLLs by MingW with STDCALL are not compatible with the ones done by Microsoft's compilers */
+#    define GLAPIENTRY 
+#  else
+#    define GLAPIENTRY __stdcall
+#  endif
 #elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
 #  define GLAPI extern
 #  define GLAPIENTRY __stdcall
-#else
-/* non-Windows compilation */
-#  define GLAPI extern
+#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+#  define GLAPI __attribute__((visibility("default")))
 #  define GLAPIENTRY
-#endif /* WIN32 / CYGWIN bracket */
+#endif /* WIN32 && !CYGWIN */
 
 #if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
 #  define PRAGMA_EXPORT_SUPPORTED              1
@@ -87,7 +88,9 @@
 #include <windows.h>
 #endif
 
-#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(_WINGDI_) && !defined(_WIN32_WCE) \
+     && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP) \
+     && !defined(__CYGWIN__) || defined(__MINGW32__)
 #include <GL/mesa_wgl.h>
 #endif
 
 #pragma import on
 #endif
 
+#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 *
@@ -432,16 +447,16 @@ typedef double            GLclampd;       /* double precision float in [0,1] */
 #define GL_OR_INVERTED                         0x150D
 
 /* Stencil */
-#define GL_STENCIL_TEST                                0x0B90
-#define GL_STENCIL_WRITEMASK                   0x0B98
 #define GL_STENCIL_BITS                                0x0D57
+#define GL_STENCIL_TEST                                0x0B90
+#define GL_STENCIL_CLEAR_VALUE                 0x0B91
 #define GL_STENCIL_FUNC                                0x0B92
 #define GL_STENCIL_VALUE_MASK                  0x0B93
-#define GL_STENCIL_REF                         0x0B97
 #define GL_STENCIL_FAIL                                0x0B94
-#define GL_STENCIL_PASS_DEPTH_PASS             0x0B96
 #define GL_STENCIL_PASS_DEPTH_FAIL             0x0B95
-#define GL_STENCIL_CLEAR_VALUE                 0x0B91
+#define GL_STENCIL_PASS_DEPTH_PASS             0x0B96
+#define GL_STENCIL_REF                         0x0B97
+#define GL_STENCIL_WRITEMASK                   0x0B98
 #define GL_STENCIL_INDEX                       0x1901
 #define GL_KEEP                                        0x1E00
 #define GL_REPLACE                             0x1E01
@@ -491,16 +506,16 @@ typedef double            GLclampd;       /* double precision float in [0,1] */
 
 /* Implementation limits */
 #define GL_MAX_LIST_NESTING                    0x0B31
-#define GL_MAX_ATTRIB_STACK_DEPTH              0x0D35
-#define GL_MAX_MODELVIEW_STACK_DEPTH           0x0D36
-#define GL_MAX_NAME_STACK_DEPTH                        0x0D37
-#define GL_MAX_PROJECTION_STACK_DEPTH          0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH             0x0D39
 #define GL_MAX_EVAL_ORDER                      0x0D30
 #define GL_MAX_LIGHTS                          0x0D31
 #define GL_MAX_CLIP_PLANES                     0x0D32
 #define GL_MAX_TEXTURE_SIZE                    0x0D33
 #define GL_MAX_PIXEL_MAP_TABLE                 0x0D34
+#define GL_MAX_ATTRIB_STACK_DEPTH              0x0D35
+#define GL_MAX_MODELVIEW_STACK_DEPTH           0x0D36
+#define GL_MAX_NAME_STACK_DEPTH                        0x0D37
+#define GL_MAX_PROJECTION_STACK_DEPTH          0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH             0x0D39
 #define GL_MAX_VIEWPORT_DIMS                   0x0D3A
 #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH       0x0D3B
 
@@ -558,22 +573,22 @@ typedef double            GLclampd;       /* double precision float in [0,1] */
 #define GL_MAP2_GRID_DOMAIN                    0x0DD2
 #define GL_MAP2_GRID_SEGMENTS                  0x0DD3
 #define GL_COEFF                               0x0A00
-#define GL_DOMAIN                              0x0A02
 #define GL_ORDER                               0x0A01
+#define GL_DOMAIN                              0x0A02
 
 /* Hints */
-#define GL_FOG_HINT                            0x0C54
-#define GL_LINE_SMOOTH_HINT                    0x0C52
 #define GL_PERSPECTIVE_CORRECTION_HINT         0x0C50
 #define GL_POINT_SMOOTH_HINT                   0x0C51
+#define GL_LINE_SMOOTH_HINT                    0x0C52
 #define GL_POLYGON_SMOOTH_HINT                 0x0C53
+#define GL_FOG_HINT                            0x0C54
 #define GL_DONT_CARE                           0x1100
 #define GL_FASTEST                             0x1101
 #define GL_NICEST                              0x1102
 
 /* Scissor box */
-#define GL_SCISSOR_TEST                                0x0C11
 #define GL_SCISSOR_BOX                         0x0C10
+#define GL_SCISSOR_TEST                                0x0C11
 
 /* Pixel Mode / Transfer */
 #define GL_MAP_COLOR                           0x0D10
@@ -678,8 +693,8 @@ typedef double              GLclampd;       /* double precision float in [0,1] */
 
 /* Errors */
 #define GL_NO_ERROR                            0x0
-#define GL_INVALID_VALUE                       0x0501
 #define GL_INVALID_ENUM                                0x0500
+#define GL_INVALID_VALUE                       0x0501
 #define GL_INVALID_OPERATION                   0x0502
 #define GL_STACK_OVERFLOW                      0x0503
 #define GL_STACK_UNDERFLOW                     0x0504
@@ -844,7 +859,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
 
 GLAPI GLenum GLAPIENTRY glGetError( void );
 
-GLAPI const GLubyte* GLAPIENTRY glGetString( GLenum name );
+GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
 
 GLAPI void GLAPIENTRY glFinish( void );
 
@@ -2143,35 +2158,24 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
 
 
 
-/*
- * ???. GL_MESA_trace
- * XXX obsolete
- */
-#ifndef GL_MESA_trace
-#define GL_MESA_trace 1
-
-#define GL_TRACE_ALL_BITS_MESA                 0xFFFF
-#define GL_TRACE_OPERATIONS_BIT_MESA           0x0001
-#define GL_TRACE_PRIMITIVES_BIT_MESA           0x0002
-#define GL_TRACE_ARRAYS_BIT_MESA               0x0004
-#define GL_TRACE_TEXTURES_BIT_MESA             0x0008
-#define GL_TRACE_PIXELS_BIT_MESA               0x0010
-#define GL_TRACE_ERRORS_BIT_MESA               0x0020
-#define GL_TRACE_MASK_MESA                     0x8755
-#define GL_TRACE_NAME_MESA                     0x8756
-
-GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
-GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
-GLAPI void GLAPIENTRY glEndTraceMESA( void );
-GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
-GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
-GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
-GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
-
-#endif /* GL_MESA_trace */
+#if GL_ARB_shader_objects
+
+#ifndef GL_MESA_shader_debug
+#define GL_MESA_shader_debug 1
+
+#define GL_DEBUG_OBJECT_MESA              0x8759
+#define GL_DEBUG_PRINT_MESA               0x875A
+#define GL_DEBUG_ASSERT_MESA              0x875B
+
+GLAPI GLhandleARB GLAPIENTRY glCreateDebugObjectMESA (void);
+GLAPI void GLAPIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+GLAPI void GLAPIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
+                                         GLsizei *length, GLcharARB *debugLog);
+GLAPI GLsizei GLAPIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
+
+#endif /* GL_MESA_shader_debug */
+
+#endif /* GL_ARB_shader_objects */
 
 
 /*
@@ -2204,17 +2208,46 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
 
 typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
 
-extern void
-glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
-                      GLvoid *data);
+GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
 
-extern void
-glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name,
-                           GLfloat *v);
+GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
 
 #endif /* GL_MESA_program_debug */
 
 
+#ifndef GL_MESA_texture_array
+#define GL_MESA_texture_array 1
+
+/* GL_MESA_texture_array uses the same enum values as GL_EXT_texture_array.
+ */
+#ifndef GL_EXT_texture_array
+
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glFramebufferTextureLayerEXT(GLenum target,
+    GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif /* GL_GLEXT_PROTOTYPES */
+
+#if 0
+/* (temporarily) disabled because of collision with typedef in glext.h
+ * that happens if apps include both gl.h and glext.h
+ */
+typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target,
+    GLenum attachment, GLuint texture, GLint level, GLint layer);
+#endif
+
+#define GL_TEXTURE_1D_ARRAY_EXT         0x8C18
+#define GL_PROXY_TEXTURE_1D_ARRAY_EXT   0x8C19
+#define GL_TEXTURE_2D_ARRAY_EXT         0x8C1A
+#define GL_PROXY_TEXTURE_2D_ARRAY_EXT   0x8C1B
+#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
+#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
+#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
+#endif
+
+#endif
+
+
 #ifndef GL_ATI_blend_equation_separate
 #define GL_ATI_blend_equation_separate 1
 
@@ -2226,16 +2259,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
 #endif /* GL_ATI_blend_equation_separate */
 
 
-/* As soon as the official glext.h is updated to include this, it will be 
- * removed from here.
- */
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES   0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-
-#endif /* GL_OES_read_format */
 
 /**
  ** NOTE!!!!!  If you add new functions to this file, or update
@@ -2244,6 +2267,7 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
  **/
 
 
+
 /**********************************************************************
  * Begin system-specific stuff
  */