mesa: Standardize names of OpenGL functions.
[mesa.git] / src / mesa / main / get.c
index c5ccd66ec2615c11931c5b73204255bcbeaf37c3..e1ebd18569f0ee2d6bd1c353b9403fbc00884590 100644 (file)
@@ -84,7 +84,6 @@
 
 enum value_type {
    TYPE_INVALID,
-   TYPE_API_MASK,
    TYPE_INT,
    TYPE_INT_2,
    TYPE_INT_3,
@@ -173,6 +172,7 @@ union value {
    LOC_CONTEXT, type, offsetof(struct gl_context, field)
 #define ARRAY_FIELD(field, type) \
    LOC_ARRAY, type, offsetof(struct gl_array_object, field)
+#undef CONST /* already defined through windows.h */
 #define CONST(value) \
    LOC_CONTEXT, TYPE_CONST, value
 
@@ -303,13 +303,9 @@ EXTRA_EXT(EXT_secondary_color);
 EXTRA_EXT(EXT_fog_coord);
 EXTRA_EXT(NV_fog_distance);
 EXTRA_EXT(EXT_texture_filter_anisotropic);
-EXTRA_EXT(IBM_rasterpos_clip);
 EXTRA_EXT(NV_point_sprite);
-EXTRA_EXT(NV_vertex_program);
-EXTRA_EXT(NV_fragment_program);
 EXTRA_EXT(NV_texture_rectangle);
 EXTRA_EXT(EXT_stencil_two_side);
-EXTRA_EXT(NV_light_max_exponent);
 EXTRA_EXT(EXT_depth_bounds_test);
 EXTRA_EXT(ARB_depth_clamp);
 EXTRA_EXT(ATI_fragment_shader);
@@ -321,7 +317,6 @@ EXTRA_EXT(ARB_fragment_program);
 EXTRA_EXT2(ARB_framebuffer_object, EXT_framebuffer_multisample);
 EXTRA_EXT(EXT_framebuffer_object);
 EXTRA_EXT(ARB_seamless_cube_map);
-EXTRA_EXT(EXT_compiled_vertex_array);
 EXTRA_EXT(ARB_sync);
 EXTRA_EXT(ARB_vertex_shader);
 EXTRA_EXT(EXT_transform_feedback);
@@ -330,35 +325,17 @@ EXTRA_EXT(ARB_transform_feedback3);
 EXTRA_EXT(EXT_pixel_buffer_object);
 EXTRA_EXT(ARB_vertex_program);
 EXTRA_EXT2(NV_point_sprite, ARB_point_sprite);
-EXTRA_EXT2(ARB_fragment_program, NV_fragment_program);
-EXTRA_EXT2(ARB_vertex_program, NV_vertex_program);
 EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program);
 EXTRA_EXT(ARB_geometry_shader4);
 EXTRA_EXT(ARB_color_buffer_float);
-EXTRA_EXT(ARB_copy_buffer);
 EXTRA_EXT(EXT_framebuffer_sRGB);
 EXTRA_EXT(ARB_texture_buffer_object);
 EXTRA_EXT(OES_EGL_image_external);
 EXTRA_EXT(ARB_blend_func_extended);
 EXTRA_EXT(ARB_uniform_buffer_object);
 EXTRA_EXT(ARB_timer_query);
-
-static const int
-extra_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
-   EXT(ARB_vertex_program),
-   EXT(ARB_fragment_program),
-   EXT(NV_vertex_program),
-   EXTRA_END
-};
-
-static const int
-extra_NV_vertex_program_ARB_vertex_program_ARB_fragment_program_NV_vertex_program[] = {
-   EXT(NV_vertex_program),
-   EXT(ARB_vertex_program),
-   EXT(ARB_fragment_program),
-   EXT(NV_vertex_program),
-   EXTRA_END
-};
+EXTRA_EXT(ARB_map_buffer_alignment);
+EXTRA_EXT(ARB_texture_cube_map_array);
 
 static const int
 extra_NV_primitive_restart[] = {
@@ -381,16 +358,11 @@ extra_ARB_vertex_program_api_es2[] = {
  * GLES2 if the NV_read_buffer extension is available. */
 static const int
 extra_NV_read_buffer_api_gl[] = {
-   EXT(NV_read_buffer),
+   EXTRA_API_ES2,
    EXTRA_API_GL,
    EXTRA_END
 };
 
-#define API_OPENGL_BIT (1 << API_OPENGL)
-#define API_OPENGLES_BIT (1 << API_OPENGLES)
-#define API_OPENGLES2_BIT (1 << API_OPENGLES2)
-#define API_OPENGL_CORE_BIT (1 << API_OPENGL_CORE)
-
 /* This is the big table describing all the enums we accept in
  * glGet*v().  The table is partitioned into six parts: enums
  * understood by all GL APIs (OpenGL, GLES and GLES2), enums shared
@@ -696,6 +668,7 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
    case GL_TEXTURE_BINDING_CUBE_MAP_ARB:
    case GL_TEXTURE_BINDING_RECTANGLE_NV:
    case GL_TEXTURE_BINDING_EXTERNAL_OES:
+   case GL_TEXTURE_BINDING_CUBE_MAP_ARRAY:
       unit = ctx->Texture.CurrentUnit;
       v->value_int =
         ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name;
@@ -732,14 +705,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
       v->value_int = ctx->CopyWriteBuffer->Name;
       break;
 
-   case GL_FRAGMENT_PROGRAM_BINDING_NV:
-      v->value_int = 
-        ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0;
-      break;
-   case GL_VERTEX_PROGRAM_BINDING_NV:
-      v->value_int =
-        ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0;
-      break;
    case GL_PIXEL_PACK_BUFFER_BINDING_EXT:
       v->value_int = ctx->Pack.BufferObj->Name;
       break;
@@ -1183,7 +1148,7 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
       break;
 
    case TYPE_DOUBLEN:
-      params[0] = ((GLdouble *) p)[0];
+      params[0] = (GLfloat) (((GLdouble *) p)[0]);
       break;
 
    case TYPE_INT_4:
@@ -1204,7 +1169,7 @@ _mesa_GetFloatv(GLenum pname, GLfloat *params)
       break;
 
    case TYPE_INT64:
-      params[0] = ((GLint64 *) p)[0];
+      params[0] = (GLfloat) (((GLint64 *) p)[0]);
       break;
 
    case TYPE_BOOLEAN:
@@ -1483,7 +1448,7 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params)
       break;
 
    case TYPE_INT64:
-      params[0] = ((GLint64 *) p)[0];
+      params[0] = (GLdouble) (((GLint64 *) p)[0]);
       break;
 
    case TYPE_BOOLEAN:
@@ -1517,7 +1482,7 @@ _mesa_GetDoublev(GLenum pname, GLdouble *params)
 }
 
 static enum value_type
-find_value_indexed(const char *func, GLenum pname, int index, union value *v)
+find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
 {
    GET_CURRENT_CONTEXT(ctx);
 
@@ -1649,7 +1614,7 @@ find_value_indexed(const char *func, GLenum pname, int index, union value *v)
 }
 
 void GLAPIENTRY
-_mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
+_mesa_GetBooleani_v( GLenum pname, GLuint index, GLboolean *params )
 {
    union value v;
    enum value_type type =
@@ -1674,7 +1639,7 @@ _mesa_GetBooleanIndexedv( GLenum pname, GLuint index, GLboolean *params )
 }
 
 void GLAPIENTRY
-_mesa_GetIntegerIndexedv( GLenum pname, GLuint index, GLint *params )
+_mesa_GetIntegeri_v( GLenum pname, GLuint index, GLint *params )
 {
    union value v;
    enum value_type type =
@@ -1723,7 +1688,6 @@ _mesa_GetInteger64Indexedv( GLenum pname, GLuint index, GLint64 *params )
    }
 }
 
-#if FEATURE_ES1
 void GLAPIENTRY
 _mesa_GetFixedv(GLenum pname, GLfixed *params)
 {
@@ -1809,4 +1773,3 @@ _mesa_GetFixedv(GLenum pname, GLfixed *params)
       break;
    }
 }
-#endif