/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 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"),
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+/*
+ * Regarding GL_NV_light_max_exponent:
+ *
+ * Portions of this software may use or implement intellectual
+ * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
+ * any and all warranties with respect to such intellectual property,
+ * including any use thereof or modifications thereto.
+ */
#include "glheader.h"
#include "colormac.h"
/* Check if named extension is enabled, if not generate error and return */
-#define CHECK_EXTENSION_B(EXTNAME, PNAME) \
- if (!ctx->Extensions.EXTNAME) { \
+#define CHECK1(E1, str, PNAME) \
+ if (!ctx->Extensions.E1) { \
_mesa_error(ctx, GL_INVALID_VALUE, \
- "glGetBooleanv(0x%x)", (int) PNAME); \
+ "glGet" str "v(0x%x)", (int) PNAME); \
return; \
- }
-
-#define CHECK_EXTENSION_I(EXTNAME, PNAME) \
- if (!ctx->Extensions.EXTNAME) { \
+ }
+
+#define CHECK2(E1, E2, str, PNAME) \
+ if (!ctx->Extensions.E1 && !ctx->Extensions.E2) { \
_mesa_error(ctx, GL_INVALID_VALUE, \
- "glGetIntegerv(0x%x)", (int) PNAME); \
+ "glGet" str "v(0x%x)", (int) PNAME); \
return; \
- }
+ }
+
+#define CHECK_EXTENSION_B(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Boolean", PNAME )
+
+#define CHECK_EXTENSION_I(EXTNAME, PNAME) \
+ CHECK1(EXTNAME, "Integer", PNAME )
#define CHECK_EXTENSION_F(EXTNAME, PNAME) \
- if (!ctx->Extensions.EXTNAME) { \
- _mesa_error(ctx, GL_INVALID_VALUE, \
- "glGetFloatv(0x%x)", (int) PNAME); \
- return; \
- }
+ CHECK1(EXTNAME, "Float", PNAME )
#define CHECK_EXTENSION_D(EXTNAME, PNAME) \
- if (!ctx->Extensions.EXTNAME) { \
- _mesa_error(ctx, GL_INVALID_VALUE, \
- "glGetDoublev(0x%x)", (int) PNAME); \
- return; \
- }
+ CHECK1(EXTNAME, "Double", PNAME )
+
+#define CHECK_EXTENSION2_B(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Boolean", PNAME)
+
+#define CHECK_EXTENSION2_I(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Integer", PNAME)
+#define CHECK_EXTENSION2_F(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Float", PNAME)
+
+#define CHECK_EXTENSION2_D(EXT1, EXT2, PNAME) \
+ CHECK2(EXT1, EXT2, "Double", PNAME)
* otherwise gets the specified parameter from the current context, converting
* it value into GLboolean.
*/
-void
+void GLAPIENTRY
_mesa_GetBooleanv( GLenum pname, GLboolean *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
return;
- /* We need this in order to get correct results for
- * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
- */
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname));
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
+
if (ctx->Driver.GetBooleanv
&& (*ctx->Driver.GetBooleanv)(ctx, pname, params))
return;
case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_BOOL(ctx->Color.BlendDstA);
break;
- case GL_BLEND_EQUATION_EXT:
- *params = ENUM_TO_BOOL( ctx->Color.BlendEquation );
+ case GL_BLEND_EQUATION:
+ *params = ENUM_TO_BOOL( ctx->Color.BlendEquationRGB );
+ break;
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+ *params = ENUM_TO_BOOL( ctx->Color.BlendEquationA );
break;
case GL_BLEND_COLOR_EXT:
params[0] = FLOAT_TO_BOOL( ctx->Color.BlendColor[0] );
break;
case GL_CURRENT_INDEX:
FLUSH_CURRENT(ctx, 0);
- *params = INT_TO_BOOL(ctx->Current.Index);
+ *params = FLOAT_TO_BOOL(ctx->Current.Index);
break;
case GL_CURRENT_NORMAL:
FLUSH_CURRENT(ctx, 0);
*params = INT_TO_BOOL(ctx->List.ListBase);
break;
case GL_LIST_INDEX:
- *params = INT_TO_BOOL( ctx->CurrentListNum );
+ *params = INT_TO_BOOL( ctx->ListState.CurrentListNum );
break;
case GL_LIST_MODE:
if (!ctx->CompileFlag)
*params = INT_TO_BOOL(0);
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = ctx->Array.TexCoord[texUnit].Enabled;
+ *params = ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Size);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].Size);
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_BOOL(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_BOOL(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = INT_TO_BOOL(ctx->Array.TexCoord[texUnit].Stride);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].Stride);
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = INT_TO_BOOL(0);
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
CHECK_EXTENSION_B(ARB_multitexture, pname);
- *params = INT_TO_BOOL(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ *params = INT_TO_BOOL(GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION_B(NV_point_sprite, pname);
+ CHECK_EXTENSION2_B(NV_point_sprite, ARB_point_sprite, pname);
*params = ctx->Point.PointSprite;
break;
case GL_POINT_SPRITE_R_MODE_NV:
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.ArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.ArrayBufferObj->Name);
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.VertexArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.Vertex.BufferObj->Name);
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.NormalArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.Normal.BufferObj->Name);
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.ColorArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.Color.BufferObj->Name);
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.IndexArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.Index.BufferObj->Name);
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.TextureArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.TexCoord[clientUnit].BufferObj->Name);
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.EdgeFlagArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.EdgeFlag.BufferObj->Name);
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.SecondaryColorArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.SecondaryColor.BufferObj->Name);
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.FogCoordArrayBufferBinding);
- break;
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.WeightArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.FogCoord.BufferObj->Name);
break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
- *params = INT_TO_BOOL(ctx->Array.ElementArrayBufferBinding);
+ *params = INT_TO_BOOL(ctx->Array.ElementArrayBufferObj->Name);
break;
#endif
* otherwise gets the specified parameter from the current context, converting
* it value into GLdouble.
*/
-void
+void GLAPIENTRY
_mesa_GetDoublev( GLenum pname, GLdouble *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
return;
- /* We need this in order to get correct results for
- * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
- */
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname));
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
+
if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
return;
case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_DOUBLE(ctx->Color.BlendDstA);
break;
- case GL_BLEND_EQUATION_EXT:
- *params = ENUM_TO_DOUBLE(ctx->Color.BlendEquation);
+ case GL_BLEND_EQUATION:
+ *params = ENUM_TO_DOUBLE(ctx->Color.BlendEquationRGB);
+ break;
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+ *params = ENUM_TO_DOUBLE(ctx->Color.BlendEquationA);
break;
case GL_BLEND_COLOR_EXT:
params[0] = (GLdouble) ctx->Color.BlendColor[0];
*params = (GLdouble) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLdouble) ctx->CurrentListNum;
+ *params = (GLdouble) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
if (!ctx->CompileFlag)
*params = 0.0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Size;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_DOUBLE(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_DOUBLE(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = (GLdouble) ctx->Array.TexCoord[texUnit].Stride;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0.0;
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
CHECK_EXTENSION_D(ARB_multitexture, pname);
- *params = (GLdouble) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ *params = (GLdouble) (GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION_B(NV_point_sprite, pname);
+ CHECK_EXTENSION2_D(NV_point_sprite, ARB_point_sprite, pname);
*params = (GLdouble) ctx->Point.PointSprite;
break;
case GL_POINT_SPRITE_R_MODE_NV:
- CHECK_EXTENSION_B(NV_point_sprite, pname);
+ CHECK_EXTENSION_D(NV_point_sprite, pname);
*params = (GLdouble) ctx->Point.SpriteRMode;
break;
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.ArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.ArrayBufferObj->Name;
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.VertexArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.Vertex.BufferObj->Name;
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.NormalArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.Normal.BufferObj->Name;
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.ColorArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.Color.BufferObj->Name;
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.IndexArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.Index.BufferObj->Name;
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.TextureArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.EdgeFlagArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.EdgeFlag.BufferObj->Name;
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.SecondaryColorArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.SecondaryColor.BufferObj->Name;
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.FogCoordArrayBufferBinding;
- break;
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.WeightArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.FogCoord.BufferObj->Name;
break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
- *params = (GLdouble) ctx->Array.ElementArrayBufferBinding;
+ *params = (GLdouble) ctx->Array.ElementArrayBufferObj->Name;
break;
#endif
* otherwise gets the specified parameter from the current context, converting
* it value into GLfloat.
*/
-void
+void GLAPIENTRY
_mesa_GetFloatv( GLenum pname, GLfloat *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
return;
- /* We need this in order to get correct results for
- * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
- */
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname));
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
+
if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
return;
case GL_BLEND_DST_ALPHA_EXT:
*params = ENUM_TO_FLOAT(ctx->Color.BlendDstA);
break;
- case GL_BLEND_EQUATION_EXT:
- *params = ENUM_TO_FLOAT(ctx->Color.BlendEquation);
+ case GL_BLEND_EQUATION:
+ *params = ENUM_TO_FLOAT(ctx->Color.BlendEquationRGB);
+ break;
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+ *params = ENUM_TO_FLOAT(ctx->Color.BlendEquationA);
break;
case GL_BLEND_COLOR_EXT:
params[0] = ctx->Color.BlendColor[0];
params[0] = ctx->Current.RasterDistance;
break;
case GL_CURRENT_RASTER_INDEX:
- *params = (GLfloat) ctx->Current.RasterIndex;
+ *params = ctx->Current.RasterIndex;
break;
case GL_CURRENT_RASTER_POSITION:
params[0] = ctx->Current.RasterPos[0];
*params = (GLfloat) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLfloat) ctx->CurrentListNum;
+ *params = (GLfloat) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
if (!ctx->CompileFlag)
*params = 0.0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Size;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ENUM_TO_FLOAT(ctx->Array.TexCoord[texUnit].Type);
+ *params = ENUM_TO_FLOAT(ctx->Array.TexCoord[clientUnit].Type);
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = (GLfloat) ctx->Array.TexCoord[texUnit].Stride;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0.0;
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
CHECK_EXTENSION_F(ARB_multitexture, pname);
- *params = (GLfloat) (GL_TEXTURE0_ARB + ctx->Array.ActiveTexture);
+ *params = (GLfloat) (GL_TEXTURE0_ARB + clientUnit);
break;
/* GL_ARB_texture_cube_map */
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION_F(NV_point_sprite, pname);
+ CHECK_EXTENSION2_F(NV_point_sprite, ARB_point_sprite, pname);
*params = (GLfloat) ctx->Point.PointSprite;
break;
case GL_POINT_SPRITE_R_MODE_NV:
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.ArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.ArrayBufferObj->Name;
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.VertexArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.Vertex.BufferObj->Name;
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.NormalArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.Normal.BufferObj->Name;
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.ColorArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.Color.BufferObj->Name;
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.IndexArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.Index.BufferObj->Name;
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.TextureArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.EdgeFlagArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.EdgeFlag.BufferObj->Name;
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.SecondaryColorArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.SecondaryColor.BufferObj->Name;
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.FogCoordArrayBufferBinding;
- break;
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.WeightArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.FogCoord.BufferObj->Name;
break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
- *params = (GLfloat) ctx->Array.ElementArrayBufferBinding;
+ *params = (GLfloat) ctx->Array.ElementArrayBufferObj->Name;
break;
#endif
* otherwise gets the specified parameter from the current context, converting
* it value into GLinteger.
*/
-void
+void GLAPIENTRY
_mesa_GetIntegerv( GLenum pname, GLint *params )
{
GET_CURRENT_CONTEXT(ctx);
GLuint i;
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
+ const GLuint texUnit = ctx->Texture.CurrentUnit;
const struct gl_texture_unit *textureUnit = &ctx->Texture.Unit[texUnit];
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
return;
-#if 0
- /* We need this in order to get correct results for
- * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
- */
- FLUSH_VERTICES(ctx, 0);
-
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(ctx, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname));
+ if (!ctx->_CurrentProgram) {
+ /* We need this in order to get correct results for
+ * GL_OCCLUSION_TEST_RESULT_HP. There might be other important cases.
+ */
+ FLUSH_VERTICES(ctx, 0);
+ }
+
if (ctx->Driver.GetIntegerv
&& (*ctx->Driver.GetIntegerv)(ctx, pname, params))
return;
-#endif
switch (pname) {
case GL_ACCUM_RED_BITS:
case GL_BLEND_DST_ALPHA_EXT:
*params = (GLint) ctx->Color.BlendDstA;
break;
- case GL_BLEND_EQUATION_EXT:
- *params = (GLint) ctx->Color.BlendEquation;
+ case GL_BLEND_EQUATION:
+ *params = (GLint) ctx->Color.BlendEquationRGB;
+ break;
+ case GL_BLEND_EQUATION_ALPHA_EXT:
+ *params = (GLint) ctx->Color.BlendEquationA;
break;
case GL_BLEND_COLOR_EXT:
params[0] = FLOAT_TO_INT( ctx->Color.BlendColor[0] );
*params = (GLint) ctx->List.ListBase;
break;
case GL_LIST_INDEX:
- *params = (GLint) ctx->CurrentListNum;
+ *params = (GLint) ctx->ListState.CurrentListNum;
break;
case GL_LIST_MODE:
if (!ctx->CompileFlag)
*params = 0;
break;
case GL_TEXTURE_COORD_ARRAY:
- *params = (GLint) ctx->Array.TexCoord[texUnit].Enabled;
+ *params = (GLint) ctx->Array.TexCoord[clientUnit].Enabled;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *params = ctx->Array.TexCoord[texUnit].Size;
+ *params = ctx->Array.TexCoord[clientUnit].Size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *params = ctx->Array.TexCoord[texUnit].Type;
+ *params = ctx->Array.TexCoord[clientUnit].Type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *params = ctx->Array.TexCoord[texUnit].Stride;
+ *params = ctx->Array.TexCoord[clientUnit].Stride;
break;
case GL_TEXTURE_COORD_ARRAY_COUNT_EXT:
*params = 0;
break;
case GL_CLIENT_ACTIVE_TEXTURE_ARB:
CHECK_EXTENSION_I(ARB_multitexture, pname);
- *params = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture;
+ *params = GL_TEXTURE0_ARB + clientUnit;
break;
/* GL_ARB_texture_cube_map */
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- CHECK_EXTENSION_I(NV_point_sprite, pname);
+ CHECK_EXTENSION2_I(NV_point_sprite, ARB_point_sprite, pname);
*params = (GLint) ctx->Point.PointSprite;
break;
case GL_POINT_SPRITE_R_MODE_NV:
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.ArrayBufferBinding;
+ *params = (GLint) ctx->Array.ArrayBufferObj->Name;
break;
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.VertexArrayBufferBinding;
+ *params = (GLint) ctx->Array.Vertex.BufferObj->Name;
break;
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.NormalArrayBufferBinding;
+ *params = (GLint) ctx->Array.Normal.BufferObj->Name;
break;
case GL_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.ColorArrayBufferBinding;
+ *params = (GLint) ctx->Array.Color.BufferObj->Name;
break;
case GL_INDEX_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.IndexArrayBufferBinding;
+ *params = (GLint) ctx->Array.Index.BufferObj->Name;
break;
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.TextureArrayBufferBinding;
+ *params = (GLint) ctx->Array.TexCoord[clientUnit].BufferObj->Name;
break;
case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.EdgeFlagArrayBufferBinding;
+ *params = (GLint) ctx->Array.EdgeFlag.BufferObj->Name;
break;
case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.SecondaryColorArrayBufferBinding;
+ *params = (GLint) ctx->Array.SecondaryColor.BufferObj->Name;
break;
case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.FogCoordArrayBufferBinding;
- break;
- case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB:
- CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.WeightArrayBufferBinding;
+ *params = (GLint) ctx->Array.FogCoord.BufferObj->Name;
break;
+ /*case GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB: - not supported */
case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
- *params = (GLint) ctx->Array.ElementArrayBufferBinding;
+ *params = (GLint) ctx->Array.ElementArrayBufferObj->Name;
break;
#endif
* Tries to get the specified pointer via dd_function_table::GetPointerv,
* otherwise gets the specified pointer from the current context.
*/
-void
+void GLAPIENTRY
_mesa_GetPointerv( GLenum pname, GLvoid **params )
{
GET_CURRENT_CONTEXT(ctx);
- GLuint texUnit = ctx->Texture.CurrentUnit;
+ const GLuint clientUnit = ctx->Array.ActiveTexture;
ASSERT_OUTSIDE_BEGIN_END(ctx);
if (!params)
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
- *params = ctx->Array.Vertex.Ptr;
+ *params = (GLvoid *) ctx->Array.Vertex.Ptr;
break;
case GL_NORMAL_ARRAY_POINTER:
- *params = ctx->Array.Normal.Ptr;
+ *params = (GLvoid *) ctx->Array.Normal.Ptr;
break;
case GL_COLOR_ARRAY_POINTER:
- *params = ctx->Array.Color.Ptr;
+ *params = (GLvoid *) ctx->Array.Color.Ptr;
break;
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
- *params = ctx->Array.SecondaryColor.Ptr;
+ *params = (GLvoid *) ctx->Array.SecondaryColor.Ptr;
break;
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
- *params = ctx->Array.FogCoord.Ptr;
+ *params = (GLvoid *) ctx->Array.FogCoord.Ptr;
break;
case GL_INDEX_ARRAY_POINTER:
- *params = ctx->Array.Index.Ptr;
+ *params = (GLvoid *) ctx->Array.Index.Ptr;
break;
case GL_TEXTURE_COORD_ARRAY_POINTER:
- *params = ctx->Array.TexCoord[texUnit].Ptr;
+ *params = (GLvoid *) ctx->Array.TexCoord[clientUnit].Ptr;
break;
case GL_EDGE_FLAG_ARRAY_POINTER:
- *params = ctx->Array.EdgeFlag.Ptr;
+ *params = (GLvoid *) ctx->Array.EdgeFlag.Ptr;
break;
case GL_FEEDBACK_BUFFER_POINTER:
*params = ctx->Feedback.Buffer;
* Tries to get the string from dd_function_table::GetString, otherwise returns
* the hardcoded strings.
*/
-const GLubyte *
+const GLubyte * GLAPIENTRY
_mesa_GetString( GLenum name )
{
GET_CURRENT_CONTEXT(ctx);
static const char *version_1_2 = "1.2 Mesa " MESA_VERSION_STRING;
static const char *version_1_3 = "1.3 Mesa " MESA_VERSION_STRING;
static const char *version_1_4 = "1.4 Mesa " MESA_VERSION_STRING;
+ static const char *version_1_5 = "1.5 Mesa " MESA_VERSION_STRING;
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
ctx->Extensions.EXT_point_parameters && /*aka ARB*/
ctx->Extensions.EXT_secondary_color &&
ctx->Extensions.EXT_stencil_wrap &&
+ ctx->Extensions.EXT_texture_lod_bias &&
ctx->Extensions.SGIS_generate_mipmap) {
- return (const GLubyte *) version_1_4;
+ if (ctx->Extensions.ARB_occlusion_query &&
+ ctx->Extensions.ARB_vertex_buffer_object &&
+ ctx->Extensions.ARB_texture_non_power_of_two &&
+ ctx->Extensions.EXT_shadow_funcs) {
+ return (const GLubyte *) version_1_5;
+ }
+ else {
+ return (const GLubyte *) version_1_4;
+ }
}
else {
return (const GLubyte *) version_1_3;
*
* Returns __GLcontextRec::ErrorValue.
*/
-GLenum
+GLenum GLAPIENTRY
_mesa_GetError( void )
{
GET_CURRENT_CONTEXT(ctx);