mesa: Move API specific context intialization into context.c
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Apr 2010 15:07:45 +0000 (11:07 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Apr 2010 16:42:17 +0000 (12:42 -0400)
src/mesa/es/main/specials_es1.c
src/mesa/es/main/specials_es2.c
src/mesa/main/context.c
src/mesa/main/context.h

index 92e24a03fe50fdd6030438e790453321a2a14a95..88f77177c8051dc32d3e66748ba95a43fe4e700b 100644 (file)
@@ -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;
-   }
-}
index 046cda6fc18ffb474a6ec4deeeea071952ef227c..75ceaff2c29c4070c62ba949badbedc39ad14706 100644 (file)
@@ -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 */
-}
index 87e5a88fad25f487ffad5cde0b777045b6fabcd0..25288a4e9c11d057c86f080a4f6bfdf045fd78c0 100644 (file)
@@ -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;
 
index e9405c8bc27aa3d849b6aa9569657683a7ee6c96..c9f4d433a573569c6f476ee7f123370a06c0b9c2 100644 (file)
@@ -127,9 +127,6 @@ _mesa_initialize_context_for_api(GLcontext *ctx,
                                 const struct dd_function_table *driverFunctions,
                                 void *driverContext);
 
-extern void
-_mesa_initialize_context_extra(GLcontext *ctx);
-
 extern void
 _mesa_free_context_data( GLcontext *ctx );