case API_OPENGLES2:
attribs.profile = ST_PROFILE_OPENGL_ES2;
break;
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
- attribs.profile = api == API_OPENGL ? ST_PROFILE_DEFAULT
- : ST_PROFILE_OPENGL_CORE;
+ attribs.profile = api == API_OPENGL_COMPAT ? ST_PROFILE_DEFAULT
+ : ST_PROFILE_OPENGL_CORE;
attribs.major = major_version;
attribs.minor = minor_version;
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
struct gl_context fakeCtx;
- fakeCtx.API = API_OPENGL;
+ fakeCtx.API = API_OPENGL_COMPAT;
fakeCtx.Const.GLSLVersion = 140;
fakeCtx.Extensions.ARB_ES2_compatibility = true;
fakeCtx.Const.ForceGLSLExtensionsWarn = false;
if (shader == NULL)
return 1;
- ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
+ ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL_COMPAT);
printf("%s", shader);
fprintf(stderr, "%s", info_log);
if (argc <= optind)
usage_fail(argv[0]);
- initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL);
+ initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL_COMPAT);
struct gl_shader_program *whole_program;
struct gl_context local_ctx;
struct gl_context *ctx = &local_ctx;
- initialize_context_to_defaults(ctx, API_OPENGL);
+ initialize_context_to_defaults(ctx, API_OPENGL_COMPAT);
ctx->Driver.NewShader = _mesa_new_shader;
condition_parts = []
if f.desktop:
if f.deprecated:
- condition_parts.append('ctx->API == API_OPENGL')
+ condition_parts.append('ctx->API == API_OPENGL_COMPAT')
else:
condition_parts.append('_mesa_is_desktop_gl(ctx)')
if 'es1' in f.api_map:
save->PolygonCull = ctx->Polygon.CullFlag;
_mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, GL_FALSE);
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_POLYGON_SMOOTH, GL_FALSE);
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, GL_FALSE);
}
}
if (state & MESA_META_SHADER) {
- if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) {
save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
_mesa_reference_vertprog(ctx, &save->VertexProgram,
ctx->VertexProgram.Current);
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE);
}
- if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) {
save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled;
_mesa_reference_fragprog(ctx, &save->FragmentProgram,
ctx->FragmentProgram.Current);
save->EnvMode = ctx->Texture.Unit[0].EnvMode;
/* Disable all texture units */
- if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
save->TexEnabled[u] = ctx->Texture.Unit[u].Enabled;
save->TexGenEnabled[u] = ctx->Texture.Unit[u].TexGenEnabled;
if (ctx->Extensions.OES_EGL_image_external)
_mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE);
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
_mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE);
if (ctx->Extensions.NV_texture_rectangle)
/* set defaults for unit[0] */
_mesa_ActiveTexture(GL_TEXTURE0);
_mesa_ClientActiveTexture(GL_TEXTURE0);
- if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
}
}
_mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode);
_mesa_PolygonMode(GL_BACK, save->BackPolygonMode);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple);
_mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth);
}
}
if (state & MESA_META_SHADER) {
- if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) {
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
save->VertexProgramEnabled);
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
_mesa_reference_vertprog(ctx, &save->VertexProgram, NULL);
}
- if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) {
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB,
save->FragmentProgramEnabled);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
_mesa_ClearStencil(stencil->Clear);
- if (ctx->API == API_OPENGL && ctx->Extensions.EXT_stencil_two_side) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_stencil_two_side) {
_mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT,
stencil->TestTwoSide);
_mesa_ActiveStencilFaceEXT(stencil->ActiveFace
ASSERT(ctx->Texture.CurrentUnit == 0);
/* restore texenv for unit[0] */
- if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode);
}
}
/* Restore fixed function texture enables, texgen */
- if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u].Enabled != save->TexEnabled[u]) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
_mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO);
- if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES)
+ if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES)
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE);
else
assert(!genMipmapSave);
switch (api) {
case __DRI_API_OPENGL:
- mesa_api = API_OPENGL;
+ mesa_api = API_OPENGL_COMPAT;
break;
case __DRI_API_GLES:
mesa_api = API_OPENGLES;
}
/* Mesa does not support the GL_ARB_compatibilty extension or the
- * compatibility profile. This means that we treat a API_OPENGL 3.1 as
- * API_OPENGL_CORE and reject API_OPENGL 3.2+.
+ * compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as
+ * API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+.
*/
- if (mesa_api == API_OPENGL && major_version == 3 && minor_version == 1)
+ if (mesa_api == API_OPENGL_COMPAT && major_version == 3 && minor_version == 1)
mesa_api = API_OPENGL_CORE;
- if (mesa_api == API_OPENGL
+ if (mesa_api == API_OPENGL_COMPAT
&& ((major_version > 3)
|| (major_version == 3 && minor_version >= 2))) {
*error = __DRI_CTX_ERROR_BAD_API;
* anything specific about this case. However, none of the known flags
* have any meaning in an ES context, so this seems safe.
*/
- if (mesa_api != API_OPENGL
+ if (mesa_api != API_OPENGL_COMPAT
&& mesa_api != API_OPENGL_CORE
&& flags != 0) {
*error = __DRI_CTX_ERROR_BAD_FLAG;
switch (api) {
case __DRI_API_OPENGL:
- mesa_api = API_OPENGL;
+ mesa_api = API_OPENGL_COMPAT;
break;
case __DRI_API_GLES:
mesa_api = API_OPENGLES;
* and version.
*/
switch (api) {
- case API_OPENGL: {
+ case API_OPENGL_COMPAT: {
const unsigned max_version =
(ctx->Extensions.ARB_fragment_shader &&
ctx->Extensions.ARB_occlusion_query) ? 20 : 15;
/* Determine max_supported_version. */
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
max_supported_version = supports_gl30 ? 30 : 21;
break;
case API_OPENGLES:
sharedContextPrivate);
} else {
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
success = false;
struct gl_context *ctx;
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
/* Do after-the-fact version checking (below).
*/
break;
nouveau_fbo_functions_init(&functions);
/* Initialize the mesa context. */
- _mesa_initialize_context(ctx, API_OPENGL, visual,
+ _mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual,
share_ctx, &functions);
nouveau_state_init(ctx);
int tcl_mode;
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
return GL_FALSE;
else
shareCtx = NULL;
- if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL,
+ if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL_COMPAT,
glVisual, shareCtx,
functions))
return GL_FALSE;
int tcl_mode, fthrottle_mode;
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
return GL_FALSE;
(void) flags;
switch (api) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
if (major_version > 2
|| (major_version == 2 && minor_version > 1)) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
switch (api) {
case API_OPENGL_CORE:
/* XXX fix me, fall-through for now */
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
_mesa_enable_1_3_extensions(mesaCtx);
_mesa_enable_1_4_extensions(mesaCtx);
_mesa_enable_1_5_extensions(mesaCtx);
functions.GetBufferSize = NULL;
if (!_mesa_initialize_context(&osmesa->mesa,
- API_OPENGL,
+ API_OPENGL_COMPAT,
osmesa->gl_visual,
sharelist ? &sharelist->mesa
: (struct gl_context *) NULL,
/* initialize the Mesa context data */
ctx = &c->gl_ctx;
- _mesa_initialize_context(ctx, API_OPENGL, visual,
+ _mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual,
NULL, &functions);
/* visual no longer needed - it was copied by _mesa_initialize_context() */
/* initialize with default driver functions, then plug in XMesa funcs */
_mesa_init_driver_functions(&functions);
xmesa_init_driver_functions(v, &functions);
- if (!_mesa_initialize_context(mesaCtx, API_OPENGL, &v->mesa_visual,
+ if (!_mesa_initialize_context(mesaCtx, API_OPENGL_COMPAT, &v->mesa_visual,
share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
&functions)) {
free(c);
SET_Color4ub(dest, _mesa_Color4ub);
SET_Materialf(dest, _mesa_Materialf);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_Color3b(dest, _mesa_Color3b);
SET_Color3d(dest, _mesa_Color3d);
SET_Color3i(dest, _mesa_Color3i);
SET_FogCoorddv(dest, _mesa_FogCoorddv);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_VertexAttrib1sNV(dest, _mesa_VertexAttrib1sNV);
SET_VertexAttrib1dNV(dest, _mesa_VertexAttrib1dNV);
SET_VertexAttrib2sNV(dest, _mesa_VertexAttrib2sNV);
return GL_FALSE;
break;
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
{
const struct gl_shader_program *vsProg =
case GL_QUADS:
case GL_QUAD_STRIP:
case GL_POLYGON:
- valid_enum = (ctx->API == API_OPENGL);
+ valid_enum = (ctx->API == API_OPENGL_COMPAT);
break;
case GL_LINES_ADJACENCY:
case GL_LINE_STRIP_ADJACENCY:
_mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV,
ctx->Point.SpriteRMode);
- if ((ctx->API == API_OPENGL && ctx->Version >= 20)
+ if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20)
|| ctx->API == API_OPENGL_CORE)
_mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
(GLfloat)ctx->Point.SpriteOrigin);
{
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
- if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) {
+ if (ctx->API == API_OPENGL_COMPAT && !ctx->Extensions.ARB_ES2_compatibility) {
struct gl_framebuffer *fb = ctx->DrawBuffer;
/* Flag the FBO as requiring validation. */
sizeof(ctx->TextureFormatSupported));
switch (ctx->API) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
ctx->Save = _mesa_create_save_table(ctx);
if (!ctx->Save) {
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
static inline GLboolean
_mesa_is_desktop_gl(const struct gl_context *ctx)
{
- return ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE;
+ return ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGL_CORE;
}
switch (cap) {
case GL_ALPHA_TEST:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Color.AlphaEnabled == state)
return;
ctx->Color.AlphaEnabled = state;
break;
case GL_AUTO_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.AutoNormal == state)
return;
}
break;
case GL_COLOR_MATERIAL:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Light.ColorMaterialEnabled == state)
return;
ctx->Color.DitherFlag = state;
break;
case GL_FOG:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Fog.Enabled == state)
return;
case GL_LIGHT5:
case GL_LIGHT6:
case GL_LIGHT7:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
return;
}
break;
case GL_LIGHTING:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Light.Enabled == state)
return;
ctx->_TriangleCaps ^= DD_LINE_SMOOTH;
break;
case GL_LINE_STIPPLE:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Line.StippleFlag == state)
return;
ctx->_TriangleCaps ^= DD_LINE_STIPPLE;
break;
case GL_INDEX_LOGIC_OP:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Color.IndexLogicOpEnabled == state)
return;
ctx->Color.ColorLogicOpEnabled = state;
break;
case GL_MAP1_COLOR_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1Color4 == state)
return;
ctx->Eval.Map1Color4 = state;
break;
case GL_MAP1_INDEX:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1Index == state)
return;
ctx->Eval.Map1Index = state;
break;
case GL_MAP1_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1Normal == state)
return;
ctx->Eval.Map1Normal = state;
break;
case GL_MAP1_TEXTURE_COORD_1:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1TextureCoord1 == state)
return;
ctx->Eval.Map1TextureCoord1 = state;
break;
case GL_MAP1_TEXTURE_COORD_2:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1TextureCoord2 == state)
return;
ctx->Eval.Map1TextureCoord2 = state;
break;
case GL_MAP1_TEXTURE_COORD_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1TextureCoord3 == state)
return;
ctx->Eval.Map1TextureCoord3 = state;
break;
case GL_MAP1_TEXTURE_COORD_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1TextureCoord4 == state)
return;
ctx->Eval.Map1TextureCoord4 = state;
break;
case GL_MAP1_VERTEX_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1Vertex3 == state)
return;
ctx->Eval.Map1Vertex3 = state;
break;
case GL_MAP1_VERTEX_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map1Vertex4 == state)
return;
ctx->Eval.Map1Vertex4 = state;
break;
case GL_MAP2_COLOR_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2Color4 == state)
return;
ctx->Eval.Map2Color4 = state;
break;
case GL_MAP2_INDEX:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2Index == state)
return;
ctx->Eval.Map2Index = state;
break;
case GL_MAP2_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2Normal == state)
return;
ctx->Eval.Map2Normal = state;
break;
case GL_MAP2_TEXTURE_COORD_1:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2TextureCoord1 == state)
return;
ctx->Eval.Map2TextureCoord1 = state;
break;
case GL_MAP2_TEXTURE_COORD_2:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2TextureCoord2 == state)
return;
ctx->Eval.Map2TextureCoord2 = state;
break;
case GL_MAP2_TEXTURE_COORD_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2TextureCoord3 == state)
return;
ctx->Eval.Map2TextureCoord3 = state;
break;
case GL_MAP2_TEXTURE_COORD_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2TextureCoord4 == state)
return;
ctx->Eval.Map2TextureCoord4 = state;
break;
case GL_MAP2_VERTEX_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2Vertex3 == state)
return;
ctx->Eval.Map2Vertex3 = state;
break;
case GL_MAP2_VERTEX_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Eval.Map2Vertex4 == state)
return;
ctx->Eval.Map2Vertex4 = state;
break;
case GL_NORMALIZE:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Transform.Normalize == state)
return;
ctx->Transform.Normalize = state;
break;
case GL_POINT_SMOOTH:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Point.SmoothFlag == state)
return;
ctx->_TriangleCaps ^= DD_TRI_SMOOTH;
break;
case GL_POLYGON_STIPPLE:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Polygon.StippleFlag == state)
return;
ctx->Polygon.OffsetFill = state;
break;
case GL_RESCALE_NORMAL_EXT:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (ctx->Transform.RescaleNormals == state)
return;
ctx->Stencil.Enabled = state;
break;
case GL_TEXTURE_1D:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
return;
}
break;
case GL_TEXTURE_2D:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
return;
}
break;
case GL_TEXTURE_3D:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
return;
{
struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (texUnit) {
/* GL_ARB_texture_cube_map */
case GL_TEXTURE_CUBE_MAP_ARB:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_texture_cube_map, cap);
if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap);
if (ctx->Fog.ColorSumEnabled == state)
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (ctx->Transform.RasterPositionUnclipped == state)
return;
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap);
if (ctx->Point.PointSprite == state)
break;
case GL_VERTEX_PROGRAM_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_vertex_program, cap);
if (ctx->VertexProgram.Enabled == state)
ctx->VertexProgram.PointSizeEnabled = state;
break;
case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_vertex_program, cap);
if (ctx->VertexProgram.TwoSideEnabled == state)
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(NV_texture_rectangle, cap);
if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) {
/* GL_EXT_stencil_two_side */
case GL_STENCIL_TEST_TWO_SIDE_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(EXT_stencil_two_side, cap);
if (ctx->Stencil.TestTwoSide == state)
break;
case GL_FRAGMENT_PROGRAM_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_fragment_program, cap);
if (ctx->FragmentProgram.Enabled == state)
break;
case GL_FRAGMENT_SHADER_ATI:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ATI_fragment_shader, cap);
if (ctx->ATIFragmentShader.Enabled == state)
/* GL_MESA_texture_array */
case GL_TEXTURE_1D_ARRAY_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(MESA_texture_array, cap);
if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) {
break;
case GL_TEXTURE_2D_ARRAY_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(MESA_texture_array, cap);
if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) {
switch (cap) {
case GL_ALPHA_TEST:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Color.AlphaEnabled;
case GL_AUTO_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.AutoNormal;
case GL_BLEND:
return (ctx->Transform.ClipPlanesEnabled >> p) & 1;
}
case GL_COLOR_MATERIAL:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Light.ColorMaterialEnabled;
case GL_CULL_FACE:
case GL_DITHER:
return ctx->Color.DitherFlag;
case GL_FOG:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Fog.Enabled;
case GL_LIGHTING:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Light.Enabled;
case GL_LIGHT0:
case GL_LIGHT5:
case GL_LIGHT6:
case GL_LIGHT7:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
case GL_LINE_SMOOTH:
goto invalid_enum_error;
return ctx->Line.SmoothFlag;
case GL_LINE_STIPPLE:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Line.StippleFlag;
case GL_INDEX_LOGIC_OP:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Color.IndexLogicOpEnabled;
case GL_COLOR_LOGIC_OP:
goto invalid_enum_error;
return ctx->Color.ColorLogicOpEnabled;
case GL_MAP1_COLOR_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1Color4;
case GL_MAP1_INDEX:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1Index;
case GL_MAP1_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1Normal;
case GL_MAP1_TEXTURE_COORD_1:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1TextureCoord1;
case GL_MAP1_TEXTURE_COORD_2:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1TextureCoord2;
case GL_MAP1_TEXTURE_COORD_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1TextureCoord3;
case GL_MAP1_TEXTURE_COORD_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1TextureCoord4;
case GL_MAP1_VERTEX_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1Vertex3;
case GL_MAP1_VERTEX_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map1Vertex4;
case GL_MAP2_COLOR_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2Color4;
case GL_MAP2_INDEX:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2Index;
case GL_MAP2_NORMAL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2Normal;
case GL_MAP2_TEXTURE_COORD_1:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2TextureCoord1;
case GL_MAP2_TEXTURE_COORD_2:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2TextureCoord2;
case GL_MAP2_TEXTURE_COORD_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2TextureCoord3;
case GL_MAP2_TEXTURE_COORD_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2TextureCoord4;
case GL_MAP2_VERTEX_3:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2Vertex3;
case GL_MAP2_VERTEX_4:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Eval.Map2Vertex4;
case GL_NORMALIZE:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Transform.Normalize;
case GL_POINT_SMOOTH:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Point.SmoothFlag;
case GL_POLYGON_SMOOTH:
goto invalid_enum_error;
return ctx->Polygon.SmoothFlag;
case GL_POLYGON_STIPPLE:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Polygon.StippleFlag;
case GL_POLYGON_OFFSET_POINT:
case GL_POLYGON_OFFSET_FILL:
return ctx->Polygon.OffsetFill;
case GL_RESCALE_NORMAL_EXT:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return ctx->Transform.RescaleNormals;
case GL_SCISSOR_TEST:
case GL_STENCIL_TEST:
return ctx->Stencil.Enabled;
case GL_TEXTURE_1D:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return is_texture_enabled(ctx, TEXTURE_1D_BIT);
case GL_TEXTURE_2D:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return is_texture_enabled(ctx, TEXTURE_2D_BIT);
case GL_TEXTURE_3D:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return is_texture_enabled(ctx, TEXTURE_3D_BIT);
case GL_TEXTURE_GEN_S:
{
const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx);
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
if (texUnit) {
/* client-side state */
case GL_VERTEX_ARRAY:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Enabled != 0);
case GL_NORMAL_ARRAY:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Enabled != 0);
case GL_COLOR_ARRAY:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Enabled != 0);
case GL_INDEX_ARRAY:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled != 0);
case GL_TEXTURE_COORD_ARRAY:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(ctx->Array.ActiveTexture)]
.Enabled != 0);
case GL_EDGE_FLAG_ARRAY:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Enabled != 0);
case GL_FOG_COORDINATE_ARRAY_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(EXT_fog_coord);
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Enabled != 0);
case GL_SECONDARY_COLOR_ARRAY_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(EXT_secondary_color);
return (ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Enabled != 0);
/* GL_EXT_secondary_color */
case GL_COLOR_SUM_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program);
return ctx->Fog.ColorSumEnabled;
/* GL_IBM_rasterpos_clip */
case GL_RASTER_POSITION_UNCLIPPED_IBM:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->Transform.RasterPositionUnclipped;
/* GL_NV_point_sprite */
case GL_POINT_SPRITE_NV:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_enum_error;
CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite)
return ctx->Point.PointSprite;
case GL_VERTEX_PROGRAM_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_vertex_program);
return ctx->VertexProgram.Enabled;
CHECK_EXTENSION(ARB_vertex_program);
return ctx->VertexProgram.PointSizeEnabled;
case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ARB_vertex_program);
return ctx->VertexProgram.TwoSideEnabled;
/* GL_NV_texture_rectangle */
case GL_TEXTURE_RECTANGLE_NV:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(NV_texture_rectangle);
return is_texture_enabled(ctx, TEXTURE_RECT_BIT);
/* GL_EXT_stencil_two_side */
case GL_STENCIL_TEST_TWO_SIDE_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(EXT_stencil_two_side);
return ctx->Stencil.TestTwoSide;
case GL_FRAGMENT_PROGRAM_ARB:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
return ctx->FragmentProgram.Enabled;
return ctx->Transform.DepthClamp;
case GL_FRAGMENT_SHADER_ATI:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum_error;
CHECK_EXTENSION(ATI_fragment_shader);
return ctx->ATIFragmentShader.Enabled;
/* GL_NV_primitive_restart */
case GL_PRIMITIVE_RESTART_NV:
- if (ctx->API != API_OPENGL || !ctx->Extensions.NV_primitive_restart) {
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_primitive_restart) {
goto invalid_enum_error;
}
return ctx->Array.PrimitiveRestart;
enum {
DISABLE = 0,
- GLL = 1 << API_OPENGL, /* GL Legacy / Compatibility */
+ GLL = 1 << API_OPENGL_COMPAT, /* GL Legacy / Compatibility */
GLC = 1 << API_OPENGL_CORE, /* GL Core */
- GL = (1 << API_OPENGL) | (1 << API_OPENGL_CORE),
+ GL = (1 << API_OPENGL_COMPAT) | (1 << API_OPENGL_CORE),
ES1 = 1 << API_OPENGLES,
ES2 = 1 << API_OPENGLES2,
};
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
- return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
+ return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_ALPHA : 0;
case GL_LUMINANCE:
case GL_LUMINANCE4:
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
- return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
+ return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE4_ALPHA4:
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
- return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
+ return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
- return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
+ return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_INTENSITY : 0;
case GL_RGB8:
return GL_RGB;
? GL_DEPTH_STENCIL_EXT : 0;
case GL_DEPTH_COMPONENT32F:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float)
? GL_DEPTH_COMPONENT : 0;
case GL_DEPTH32F_STENCIL8:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float)
? GL_DEPTH_STENCIL : 0;
case GL_RED:
case GL_R16:
/* signed normalized texture formats */
case GL_R8_SNORM:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RED : 0;
case GL_RED_SNORM:
case GL_R16_SNORM:
? GL_RED : 0;
case GL_RG8_SNORM:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RG : 0;
case GL_RG_SNORM:
case GL_RG16_SNORM:
? GL_RG : 0;
case GL_RGB8_SNORM:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RGB : 0;
case GL_RGB_SNORM:
case GL_RGB16_SNORM:
? GL_RGB : 0;
case GL_RGBA8_SNORM:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
+ || (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RGBA : 0;
case GL_RGBA_SNORM:
case GL_RGBA16_SNORM:
case GL_ALPHA_SNORM:
case GL_ALPHA8_SNORM:
case GL_ALPHA16_SNORM:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
case GL_LUMINANCE_SNORM:
case GL_LUMINANCE8_SNORM:
case GL_LUMINANCE16_SNORM:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA_SNORM:
case GL_LUMINANCE8_ALPHA8_SNORM:
case GL_LUMINANCE16_ALPHA16_SNORM:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY_SNORM:
case GL_INTENSITY8_SNORM:
case GL_INTENSITY16_SNORM:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
case GL_R16F:
case GL_R32F:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL &&
+ || (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_rg &&
ctx->Extensions.ARB_texture_float) ? GL_RED : 0;
case GL_RG16F:
case GL_RG32F:
return ctx->Version >= 30
- || (ctx->API == API_OPENGL &&
+ || (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_rg &&
ctx->Extensions.ARB_texture_float) ? GL_RG : 0;
case GL_RGB16F:
? GL_RGBA : 0;
case GL_ALPHA16F_ARB:
case GL_ALPHA32F_ARB:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
case GL_LUMINANCE16F_ARB:
case GL_LUMINANCE32F_ARB:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA16F_ARB:
case GL_LUMINANCE_ALPHA32F_ARB:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY16F_ARB:
case GL_INTENSITY32F_ARB:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
case GL_RGB9_E5:
case GL_INTENSITY16UI_EXT:
case GL_INTENSITY32I_EXT:
case GL_INTENSITY32UI_EXT:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
case GL_LUMINANCE16UI_EXT:
case GL_LUMINANCE32I_EXT:
case GL_LUMINANCE32UI_EXT:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA16UI_EXT:
case GL_LUMINANCE_ALPHA32I_EXT:
case GL_LUMINANCE_ALPHA32UI_EXT:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
case GL_ALPHA16UI_EXT:
case GL_ALPHA32I_EXT:
case GL_ALPHA32UI_EXT:
- return ctx->API == API_OPENGL &&
+ return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
}
return;
case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
- if ((ctx->API != API_OPENGL || !ctx->Extensions.ARB_framebuffer_object)
+ if ((ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_framebuffer_object)
&& ctx->API != API_OPENGL_CORE
&& !_mesa_is_gles3(ctx)) {
goto invalid_pname_enum;
/* Accumulation buffers and auxilary buffers were removed in
* OpenGL 3.1, and they never existed in OpenGL ES.
*/
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_enum;
break;
case GL_COLOR:
update_fog_scale(ctx);
break;
case GL_FOG_INDEX:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
if (ctx->Fog.Index == *params)
return;
break;
case GL_FOG_COORDINATE_SOURCE_EXT: {
GLenum p = (GLenum) (GLint) *params;
- if (ctx->API != API_OPENGL || !ctx->Extensions.EXT_fog_coord ||
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.EXT_fog_coord ||
(p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
return;
}
case GL_FOG_DISTANCE_MODE_NV: {
GLenum p = (GLenum) (GLint) *params;
- if (ctx->API != API_OPENGL || !ctx->Extensions.NV_fog_distance ||
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_fog_distance ||
(p != GL_EYE_RADIAL_NV && p != GL_EYE_PLANE && p != GL_EYE_PLANE_ABSOLUTE_NV)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
return;
int i, j, collisions[11], count, hash, mask;
const struct value_desc *d;
const char *api_names[] = {
- [API_OPENGL] = "GL",
+ [API_OPENGL_COMPAT] = "GL",
[API_OPENGL_CORE] = "GL_CORE",
[API_OPENGLES] = "GLES",
[API_OPENGLES2] = "GLES2",
shading_language_version(struct gl_context *ctx)
{
switch (ctx->API) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
if (!ctx->Extensions.ARB_shader_objects) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetString");
break;
return shading_language_version(ctx);
case GL_PROGRAM_ERROR_STRING_NV:
- if (ctx->API == API_OPENGL &&
+ if (ctx->API == API_OPENGL_COMPAT &&
(ctx->Extensions.ARB_fragment_program ||
ctx->Extensions.ARB_vertex_program)) {
return (const GLubyte *) ctx->Program.ErrorString;
switch (pname) {
case GL_VERTEX_ARRAY_POINTER:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POS].Ptr;
break;
case GL_NORMAL_ARRAY_POINTER:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
break;
case GL_COLOR_ARRAY_POINTER:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr;
break;
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr;
break;
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_FOG].Ptr;
break;
case GL_INDEX_ARRAY_POINTER:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr;
break;
case GL_TEXTURE_COORD_ARRAY_POINTER:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_TEX(clientUnit)].Ptr;
break;
case GL_EDGE_FLAG_ARRAY_POINTER:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr;
break;
case GL_FEEDBACK_BUFFER_POINTER:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = ctx->Feedback.Buffer;
break;
case GL_SELECTION_BUFFER_POINTER:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = ctx->Select.Buffer;
break;
case GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT:
case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
- return ctx->API == API_OPENGL
+ return ctx->API == API_OPENGL_COMPAT
&& ctx->Extensions.EXT_texture_compression_latc;
case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
- return ctx->API == API_OPENGL
+ return ctx->API == API_OPENGL_COMPAT
&& ctx->Extensions.ATI_texture_compression_3dc;
case GL_ETC1_RGB8_OES:
return _mesa_is_gles(ctx)
switch (target) {
case GL_FOG_HINT:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_target;
if (ctx->Hint.Fog == mode)
return;
ctx->Hint.LineSmooth = mode;
break;
case GL_PERSPECTIVE_CORRECTION_HINT:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_target;
if (ctx->Hint.PerspectiveCorrection == mode)
return;
ctx->Hint.PerspectiveCorrection = mode;
break;
case GL_POINT_SMOOTH_HINT:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_target;
if (ctx->Hint.PointSmooth == mode)
return;
/* GL_EXT_clip_volume_hint */
case GL_CLIP_VOLUME_CLIPPING_HINT_EXT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_target;
if (ctx->Hint.ClipVolumeClipping == mode)
return;
COPY_4V( ctx->Light.Model.Ambient, params );
break;
case GL_LIGHT_MODEL_LOCAL_VIEWER:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
newbool = (params[0]!=0.0);
if (ctx->Light.Model.LocalViewer == newbool)
ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
if (params[0] == (GLfloat) GL_SINGLE_COLOR)
newenum = GL_SINGLE_COLOR;
*params = mat[MAT_ATTRIB_SHININESS(f)][0];
break;
case GL_COLOR_INDEXES:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" );
return;
}
GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* update materials */
- ASSERT(ctx->API == API_OPENGL);
+ ASSERT(ctx->API == API_OPENGL_COMPAT);
FLUSH_CURRENT(ctx, 0); /* update ctx->Light.Material from vertex buffer */
case GL_MATRIX5_ARB:
case GL_MATRIX6_ARB:
case GL_MATRIX7_ARB:
- if (ctx->API == API_OPENGL
+ if (ctx->API == API_OPENGL_COMPAT
&& (ctx->Extensions.ARB_vertex_program ||
ctx->Extensions.ARB_fragment_program)) {
const GLuint m = mode - GL_MATRIX0_ARB;
*/
typedef enum
{
- API_OPENGL, /* legacy / compatibility contexts */
+ API_OPENGL_COMPAT, /* legacy / compatibility contexts */
API_OPENGLES,
API_OPENGLES2,
API_OPENGL_CORE,
/* GL_POINT_SPRITE_COORD_ORIGIN was added to point sprites when the
* extension was merged into OpenGL 2.0.
*/
- if ((ctx->API == API_OPENGL && ctx->Version >= 20)
+ if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20)
|| ctx->API == API_OPENGL_CORE) {
GLenum value = (GLenum) params[0];
if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) {
q = _mesa_lookup_query_object(ctx, id);
if (!q) {
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glBeginQuery{Indexed}(non-gen name)");
return;
/* Is transform feedback available in this context?
*/
const bool has_xfb =
- (ctx->API == API_OPENGL && ctx->Extensions.EXT_transform_feedback)
+ (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_transform_feedback)
|| ctx->API == API_OPENGL_CORE
|| _mesa_is_gles3(ctx);
/* Are uniform buffer objects available in this context?
*/
const bool has_ubo =
- (ctx->API == API_OPENGL && ctx->Extensions.ARB_uniform_buffer_object)
+ (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_uniform_buffer_object)
|| ctx->API == API_OPENGL_CORE
|| _mesa_is_gles3(ctx);
SET_GetAttribLocation(exec, _mesa_GetAttribLocation);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
break;
case GL_DOT3_RGB_EXT:
case GL_DOT3_RGBA_EXT:
- legal = (ctx->API == API_OPENGL &&
+ legal = (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_env_dot3 &&
pname == GL_COMBINE_RGB);
break;
case GL_MODULATE_ADD_ATI:
case GL_MODULATE_SIGNED_ADD_ATI:
case GL_MODULATE_SUBTRACT_ATI:
- legal = (ctx->API == API_OPENGL &&
+ legal = (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ATI_texture_env_combine3);
break;
case GL_BUMP_ENVMAP_ATI:
- legal = (ctx->API == API_OPENGL &&
+ legal = (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ATI_envmap_bumpmap &&
pname == GL_COMBINE_RGB);
break;
return;
}
- if ((term == 3) && (ctx->API != API_OPENGL
+ if ((term == 3) && (ctx->API != API_OPENGL_COMPAT
|| !ctx->Extensions.NV_texture_env_combine4)) {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
param - GL_TEXTURE0 < ctx->Const.MaxTextureUnits);
break;
case GL_ZERO:
- legal = (ctx->API == API_OPENGL &&
+ legal = (ctx->API == API_OPENGL_COMPAT &&
(ctx->Extensions.ATI_texture_env_combine3 ||
ctx->Extensions.NV_texture_env_combine4));
break;
case GL_ONE:
- legal = (ctx->API == API_OPENGL &&
+ legal = (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ATI_texture_env_combine3);
break;
default:
return;
}
- if ((term == 3) && (ctx->API != API_OPENGL
+ if ((term == 3) && (ctx->API != API_OPENGL_COMPAT
|| !ctx->Extensions.NV_texture_env_combine4)) {
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
return;
set_combiner_scale(ctx, texUnit, pname, param[0]);
break;
case GL_BUMP_TARGET_ATI:
- if (ctx->API != API_OPENGL || !ctx->Extensions.ATI_envmap_bumpmap) {
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ATI_envmap_bumpmap) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(pname=0x%x)", pname );
return;
}
return texUnit->Combine.SourceRGB[rgb_idx];
}
case GL_SOURCE3_RGB_NV:
- if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.SourceRGB[3];
}
else {
return texUnit->Combine.SourceA[alpha_idx];
}
case GL_SOURCE3_ALPHA_NV:
- if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.SourceA[3];
}
else {
return texUnit->Combine.OperandRGB[op_rgb];
}
case GL_OPERAND3_RGB_NV:
- if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.OperandRGB[3];
}
else {
return texUnit->Combine.OperandA[op_alpha];
}
case GL_OPERAND3_ALPHA_NV:
- if (ctx->API == API_OPENGL && ctx->Extensions.NV_texture_env_combine4) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.NV_texture_env_combine4) {
return texUnit->Combine.OperandA[3];
}
else {
return 1 << texUnit->Combine.ScaleShiftA;
case GL_BUMP_TARGET_ATI:
/* spec doesn't say so, but I think this should be queryable */
- if (ctx->API == API_OPENGL && ctx->Extensions.ATI_envmap_bumpmap) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ATI_envmap_bumpmap) {
return texUnit->BumpTarget;
}
else {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
return;
}
- if (ctx->API != API_OPENGL
+ if (ctx->API != API_OPENGL_COMPAT
&& (bit & (TEXGEN_REFLECTION_MAP_NV | TEXGEN_NORMAL_MAP_NV)) == 0) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
return;
case GL_OBJECT_PLANE:
{
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
return;
}
{
GLfloat tmp[4];
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
return;
}
params[0] = ENUM_TO_FLOAT(texgen->Mode);
break;
case GL_OBJECT_PLANE:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(param)" );
return;
}
COPY_4V(params, texgen->ObjectPlane);
break;
case GL_EYE_PLANE:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGenfv(param)" );
return;
}
params[0] = texgen->Mode;
break;
case GL_OBJECT_PLANE:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(param)" );
return;
}
params[3] = (GLint) texgen->ObjectPlane[3];
break;
case GL_EYE_PLANE:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(param)" );
return;
}
/* Check border */
if (border < 0 || border > 1 ||
- ((ctx->API != API_OPENGL ||
+ ((ctx->API != API_OPENGL_COMPAT ||
target == GL_TEXTURE_RECTANGLE_NV ||
target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
_mesa_error(ctx, GL_INVALID_VALUE,
/* Check border */
if (border < 0 || border > 1 ||
- ((ctx->API != API_OPENGL ||
+ ((ctx->API != API_OPENGL_COMPAT ||
target == GL_TEXTURE_RECTANGLE_NV ||
target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
_mesa_error(ctx, GL_INVALID_VALUE,
/* GL_CLAMP was removed in the core profile, and it has never existed in
* OpenGL ES.
*/
- supported = (ctx->API == API_OPENGL)
+ supported = (ctx->API == API_OPENGL_COMPAT)
&& (target != GL_TEXTURE_EXTERNAL_OES);
break;
return GL_TRUE;
case GL_GENERATE_MIPMAP_SGIS:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
if (params[0] && texObj->Target == GL_TEXTURE_EXTERNAL_OES)
/* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has never
* existed in OpenGL ES.
*/
- if (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_texture) {
+ if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_texture) {
if (texObj->DepthMode == params[0])
return GL_FALSE;
if (params[0] == GL_LUMINANCE ||
return GL_TRUE;
case GL_TEXTURE_PRIORITY:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
flush(ctx);
* It was removed in core-profile, and it has never existed in OpenGL
* ES.
*/
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
if (texObj->Sampler.LodBias != params[0]) {
}
break;
case GL_TEXTURE_RESIDENT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = 1.0F;
break;
case GL_TEXTURE_PRIORITY:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = obj->Priority;
*params = obj->Sampler.MaxAnisotropy;
break;
case GL_GENERATE_MIPMAP_SGIS:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLfloat) obj->GenerateMipmap;
/* GL_DEPTH_TEXTURE_MODE_ARB is removed in core-profile and it has
* never existed in OpenGL ES.
*/
- if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture)
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture)
goto invalid_pname;
*params = (GLfloat) obj->DepthMode;
break;
case GL_TEXTURE_LOD_BIAS:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = obj->Sampler.LodBias;
}
break;
case GL_TEXTURE_RESIDENT:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = 1;
break;
case GL_TEXTURE_PRIORITY:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = FLOAT_TO_INT(obj->Priority);
*params = (GLint) obj->Sampler.MaxAnisotropy;
break;
case GL_GENERATE_MIPMAP_SGIS:
- if (ctx->API != API_OPENGL && ctx->API != API_OPENGLES)
+ if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
goto invalid_pname;
*params = (GLint) obj->GenerateMipmap;
*params = (GLint) obj->Sampler.CompareFunc;
break;
case GL_DEPTH_TEXTURE_MODE_ARB:
- if (ctx->API != API_OPENGL || !ctx->Extensions.ARB_depth_texture)
+ if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.ARB_depth_texture)
goto invalid_pname;
*params = (GLint) obj->DepthMode;
break;
case GL_TEXTURE_LOD_BIAS:
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
goto invalid_pname;
*params = (GLint) obj->Sampler.LodBias;
} else if (ctx->Version >= 31) {
ctx->API = API_OPENGL_CORE;
} else {
- ctx->API = API_OPENGL;
+ ctx->API = API_OPENGL_COMPAT;
}
create_version_string(ctx, "");
}
return;
switch (ctx->API) {
- case API_OPENGL:
+ case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
compute_version(ctx);
break;
SET_Color4f(tab, vfmt->Color4f);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_install_arrayelt_vtxfmt(tab, vfmt);
SET_Color3f(tab, vfmt->Color3f);
SET_Color3fv(tab, vfmt->Color3fv);
SET_EdgeFlag(tab, vfmt->EdgeFlag);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_install_eval_vtxfmt(tab, vfmt);
}
SET_Normal3f(tab, vfmt->Normal3f);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT);
SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT);
SET_Indexf(tab, vfmt->Indexf);
SET_Normal3fv(tab, vfmt->Normal3fv);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_SecondaryColor3fEXT(tab, vfmt->SecondaryColor3fEXT);
SET_SecondaryColor3fvEXT(tab, vfmt->SecondaryColor3fvEXT);
SET_TexCoord1f(tab, vfmt->TexCoord1f);
SET_Vertex4fv(tab, vfmt->Vertex4fv);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
_mesa_install_dlist_vtxfmt(tab, vfmt); /* glCallList / glCallLists */
SET_Begin(tab, vfmt->Begin);
}
/* Originally for GL_NV_vertex_program, this is also used by dlist.c */
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
SET_VertexAttrib1fvNV(tab, vfmt->VertexAttrib1fvNV);
SET_VertexAttrib2fNV(tab, vfmt->VertexAttrib2fNV);
SET_VertexAttribI4uivEXT(tab, vfmt->VertexAttribI4uiv);
}
- if (ctx->API == API_OPENGL) {
+ if (ctx->API == API_OPENGL_COMPAT) {
/* GL_ARB_vertex_type_10_10_10_2_rev / GL 3.3 */
SET_VertexP2ui(tab, vfmt->VertexP2ui);
SET_VertexP2uiv(tab, vfmt->VertexP2uiv);
ctx->Extensions.NV_texture_rectangle = GL_TRUE;
ctx->Extensions.OES_EGL_image = GL_TRUE;
- if (ctx->API != API_OPENGL)
+ if (ctx->API != API_OPENGL_COMPAT)
ctx->Extensions.OES_EGL_image_external = GL_TRUE;
ctx->Extensions.OES_draw_texture = GL_TRUE;
switch (attribs->profile) {
case ST_PROFILE_DEFAULT:
- api = API_OPENGL;
+ api = API_OPENGL_COMPAT;
break;
case ST_PROFILE_OPENGL_ES1:
api = API_OPENGLES;
* vtxfmt mechanism can be removed now.
*/
vbo_exec_init( ctx );
- if (ctx->API == API_OPENGL)
+ if (ctx->API == API_OPENGL_COMPAT)
vbo_save_init( ctx );
_math_init_eval();
}
vbo_exec_destroy(ctx);
- if (ctx->API == API_OPENGL)
+ if (ctx->API == API_OPENGL_COMPAT)
vbo_save_destroy(ctx);
free(vbo);
ctx->swtnl_im = NULL;
updateMats = ALL_MATERIAL_BITS;
}
- if (ctx->API == API_OPENGL && face == GL_FRONT) {
+ if (ctx->API == API_OPENGL_COMPAT && face == GL_FRONT) {
updateMats &= FRONT_MATERIAL_BITS;
}
- else if (ctx->API == API_OPENGL && face == GL_BACK) {
+ else if (ctx->API == API_OPENGL_COMPAT && face == GL_BACK) {
updateMats &= BACK_MATERIAL_BITS;
}
else if (face != GL_FRONT_AND_BACK) {
MAT_ATTR(VBO_ATTRIB_MAT_BACK_SHININESS, 1, params);
break;
case GL_COLOR_INDEXES:
- if (ctx->API != API_OPENGL) {
+ if (ctx->API != API_OPENGL_COMPAT) {
_mesa_error(ctx, GL_INVALID_ENUM, "glMaterialfv(pname)");
return;
}