--- /dev/null
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.9
+ *
+ * Copyright (C) 2010 LunarG Inc.
+ *
+ * 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
+ * THE AUTHORS OR COPYRIGHT HOLDERS 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.
+ *
+ * Authors:
+ * Chia-I Wu <olv@lunarg.com>
+ */
+
+
+/**
+ * \file core.h
+ * The public header of core mesa.
+ *
+ * This file is the (only) public header of core mesa. It is supposed to be
+ * used by GLX, WGL, and GLSL. It is important that headers directly or
+ * indirectly included here do not perform feature tests (#if FEATURE_xxx).
+ */
+
+
+#ifndef CORE_H
+#define CORE_H
+
+
+#include "main/glheader.h"
+#include "main/compiler.h"
+#include "main/imports.h"
+#include "main/macros.h"
+
+#include "main/version.h" /* for MESA_VERSION_STRING */
+#include "main/context.h" /* for _mesa_share_state */
+#include "main/mtypes.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* for GLSL */
+#include "program/prog_parameter.h"
+#include "program/prog_uniform.h"
+
+#ifdef __cplusplus
+};
+#endif
+
+
+#endif /* CORE_H */
struct gl_pixelstore_attrib;
struct gl_display_list;
-#if FEATURE_ARB_vertex_buffer_object
+/* GL_ARB_vertex_buffer_object */
/* Modifies GL_MAP_UNSYNCHRONIZED_BIT to allow driver to fail (return
* NULL) if buffer is unavailable for immediate mapping.
*
* respect the contents of already referenced data.
*/
#define MESA_MAP_NOWAIT_BIT 0x0040
-#endif
/**
/**
* \name Vertex/pixel buffer object functions
*/
-#if FEATURE_ARB_vertex_buffer_object
/*@{*/
void (*BindBuffer)( GLcontext *ctx, GLenum target,
struct gl_buffer_object *obj );
GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target,
struct gl_buffer_object *obj );
/*@}*/
-#endif
/**
* \name Functions for GL_APPLE_object_purgeable
*/
-#if FEATURE_APPLE_object_purgeable
/*@{*/
/* variations on ObjectPurgeable */
GLenum (*BufferObjectPurgeable)( GLcontext *ctx, struct gl_buffer_object *obj, GLenum option );
GLenum (*RenderObjectUnpurgeable)( GLcontext *ctx, struct gl_renderbuffer *obj, GLenum option );
GLenum (*TextureObjectUnpurgeable)( GLcontext *ctx, struct gl_texture_object *obj, GLenum option );
/*@}*/
-#endif
/**
- * \name Functions for GL_EXT_framebuffer_object
+ * \name Functions for GL_EXT_framebuffer_{object,blit}.
*/
-#if FEATURE_EXT_framebuffer_object
/*@{*/
struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name);
struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name);
void (*ValidateFramebuffer)(GLcontext *ctx,
struct gl_framebuffer *fb);
/*@}*/
-#endif
-#if FEATURE_EXT_framebuffer_blit
void (*BlitFramebuffer)(GLcontext *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
-#endif
/**
* \name Query objects
void (*EndCallList)( GLcontext *ctx );
-#if FEATURE_ARB_sync
/**
* \name GL_ARB_sync interfaces
*/
void (*ServerWaitSync)(GLcontext *, struct gl_sync_object *,
GLbitfield, GLuint64);
/*@}*/
-#endif
/** GL_NV_conditional_render */
void (*BeginConditionalRender)(GLcontext *ctx, struct gl_query_object *q,
GLenum mode);
void (*EndConditionalRender)(GLcontext *ctx, struct gl_query_object *q);
-#if FEATURE_OES_draw_texture
/**
* \name GL_OES_draw_texture interface
*/
void (*DrawTex)(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
GLfloat width, GLfloat height);
/*@}*/
-#endif
-#if FEATURE_OES_EGL_image
+ /**
+ * \name GL_OES_EGL_image interface
+ */
void (*EGLImageTargetTexture2D)(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
void (*EGLImageTargetRenderbufferStorage)(GLcontext *ctx,
struct gl_renderbuffer *rb,
void *image_handle);
-#endif
-#if FEATURE_EXT_transform_feedback
+ /**
+ * \name GL_EXT_transform_feedback interface
+ */
struct gl_transform_feedback_object *
(*NewTransformFeedback)(GLcontext *ctx, GLuint name);
void (*DeleteTransformFeedback)(GLcontext *ctx,
struct gl_transform_feedback_object *obj);
void (*DrawTransformFeedback)(GLcontext *ctx, GLenum mode,
struct gl_transform_feedback_object *obj);
-#endif
};
void (GLAPIENTRYP VertexAttrib3fvNV)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib4fNV)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
void (GLAPIENTRYP VertexAttrib4fvNV)( GLuint index, const GLfloat *v );
-#if FEATURE_ARB_vertex_program
+ /* GL_ARB_vertex_program */
void (GLAPIENTRYP VertexAttrib1fARB)( GLuint index, GLfloat x );
void (GLAPIENTRYP VertexAttrib1fvARB)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib2fARB)( GLuint index, GLfloat x, GLfloat y );
void (GLAPIENTRYP VertexAttrib3fvARB)( GLuint index, const GLfloat *v );
void (GLAPIENTRYP VertexAttrib4fARB)( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
void (GLAPIENTRYP VertexAttrib4fvARB)( GLuint index, const GLfloat *v );
-#endif
/*@}*/
void (GLAPIENTRYP Rectf)( GLfloat, GLfloat, GLfloat, GLfloat );
GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */
-#if FEATURE_ARB_vertex_buffer_object
+ /* GL_ARB_vertex_buffer_object */
struct gl_buffer_object *ArrayBufferObj;
struct gl_buffer_object *ElementArrayBufferObj;
-#endif
};
*/
/*@{*/
struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */
-#if FEATURE_ARB_vertex_program
struct gl_vertex_program *DefaultVertexProgram;
-#endif
-#if FEATURE_ARB_fragment_program
struct gl_fragment_program *DefaultFragmentProgram;
-#endif
-#if FEATURE_ARB_geometry_shader4
struct gl_geometry_program *DefaultGeometryProgram;
-#endif
/*@}*/
-#if FEATURE_ATI_fragment_shader
+ /* GL_ATI_fragment_shader */
struct _mesa_HashTable *ATIShaders;
struct ati_fragment_shader *DefaultFragmentShader;
-#endif
-#if FEATURE_ARB_vertex_buffer_object || FEATURE_ARB_pixel_buffer_object
struct _mesa_HashTable *BufferObjects;
-#endif
-#if FEATURE_ARB_shader_objects
/** Table of both gl_shader and gl_shader_program objects */
struct _mesa_HashTable *ShaderObjects;
-#endif
-#if FEATURE_EXT_framebuffer_object
+ /* GL_EXT_framebuffer_object */
struct _mesa_HashTable *RenderBuffers;
struct _mesa_HashTable *FrameBuffers;
-#endif
-#if FEATURE_ARB_sync
+ /* GL_ARB_sync */
struct simple_node SyncObjects;
-#endif
void *DriverData; /**< Device driver shared state */
};
GLuint MaxNativeParameters;
/* For shaders */
GLuint MaxUniformComponents;
-#if FEATURE_ARB_geometry_shader4
+ /* GL_ARB_geometry_shader4 */
GLuint MaxGeometryTextureImageUnits;
GLuint MaxGeometryVaryingComponents;
GLuint MaxVertexVaryingComponents;
GLuint MaxGeometryUniformComponents;
GLuint MaxGeometryOutputVertices;
GLuint MaxGeometryTotalOutputComponents;
-#endif
};
GLboolean SGIS_texture_lod;
GLboolean TDFX_texture_compression_FXT1;
GLboolean S3_s3tc;
-#if FEATURE_OES_EGL_image
GLboolean OES_EGL_image;
-#endif
-#if FEATURE_OES_draw_texture
GLboolean OES_draw_texture;
-#endif /* FEATURE_OES_draw_texture */
/** The extension string */
const GLubyte *String;
/** Number of supported extensions */
struct gl_meta_state *Meta; /**< for "meta" operations */
-#if FEATURE_EXT_framebuffer_object
+ /* GL_EXT_framebuffer_object */
struct gl_renderbuffer *CurrentRenderbuffer;
-#endif
GLenum ErrorValue; /**< Last error code */