summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2010-04-22 11:07:45 -0400
committerKristian Høgsberg <[email protected]>2010-04-22 12:42:17 -0400
commit218ceb3e1874a5a28f36a8df3ca0e881cdf213d5 (patch)
tree8cd99644c993d81b3d9936b736da1ad87cd3d25c /src/mesa
parent38d771c0539a087db42d8d940bb2e920bb64598c (diff)
mesa: Move API specific context intialization into context.c
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/es/main/specials_es1.c21
-rw-r--r--src/mesa/es/main/specials_es2.c10
-rw-r--r--src/mesa/main/context.c28
-rw-r--r--src/mesa/main/context.h3
4 files changed, 25 insertions, 37 deletions
diff --git a/src/mesa/es/main/specials_es1.c b/src/mesa/es/main/specials_es1.c
index 92e24a03fe5..88f77177c80 100644
--- a/src/mesa/es/main/specials_es1.c
+++ b/src/mesa/es/main/specials_es1.c
@@ -195,24 +195,3 @@ _es_GetString(GLenum name)
return _mesa_GetString(name);
}
}
-
-
-void
-_mesa_initialize_context_extra(GLcontext *ctx)
-{
- GLuint i;
-
- /**
- * GL_OES_texture_cube_map says
- * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
- */
- for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
- struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
- texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
- texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
- }
-}
diff --git a/src/mesa/es/main/specials_es2.c b/src/mesa/es/main/specials_es2.c
index 046cda6fc18..75ceaff2c29 100644
--- a/src/mesa/es/main/specials_es2.c
+++ b/src/mesa/es/main/specials_es2.c
@@ -167,13 +167,3 @@ _es_GetString(GLenum name)
return _mesa_GetString(name);
}
}
-
-
-void
-_mesa_initialize_context_extra(GLcontext *ctx)
-{
- ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
- ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
-
- ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
-}
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 87e5a88fad2..25288a4e9c1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -808,6 +808,7 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
void *driverContext)
{
struct gl_shared_state *shared;
+ int i;
/*ASSERT(driverContext);*/
assert(driverFunctions->NewTextureObject);
@@ -886,9 +887,30 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
}
-#if FEATURE_extra_context_init
- _mesa_initialize_context_extra(ctx);
-#endif
+ switch (ctx->API) {
+ case API_OPENGL:
+ break;
+ case API_OPENGLES:
+ /**
+ * GL_OES_texture_cube_map says
+ * "Initially all texture generation modes are set to REFLECTION_MAP_OES"
+ */
+ for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
+ struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
+ texUnit->GenS.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenT.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenR.Mode = GL_REFLECTION_MAP_NV;
+ texUnit->GenS._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenT._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ texUnit->GenR._ModeBit = TEXGEN_REFLECTION_MAP_NV;
+ }
+ break;
+ case API_OPENGLES2:
+ ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
+ ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
+ ctx->Point.PointSprite = GL_TRUE; /* always on for ES 2.x */
+ break;
+ }
ctx->FirstTimeCurrent = GL_TRUE;
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index e9405c8bc27..c9f4d433a57 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -128,9 +128,6 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
void *driverContext);
extern void
-_mesa_initialize_context_extra(GLcontext *ctx);
-
-extern void
_mesa_free_context_data( GLcontext *ctx );
extern void