Index: /orxonox/trunk/src/lib/graphics/importer/model.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 3915)
+++ /orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 3916)
@@ -33,10 +33,10 @@
    \brief Creates a 3D-Model. and assigns it a Name.
 */
-Model::Model(const char* modelName)
+Model::Model(const char* modelName, MODEL_TYPE type)
 {
   PRINTF(4)("new 3D-Model is being created\n"); 
   this->name = NULL;
   this->setName(modelName);
-
+  this->type = type;
 
   this->finalized = false;
@@ -82,7 +82,9 @@
     }
 
+  // deleting Arrays
+  this->deleteArrays();
+
   // deleting the MaterialList
   PRINTF(5)("Deleting Materials.\n");
-
   tIterator<Material>* tmpIt = this->materialList->getIterator();
   Material* material = tmpIt->nextElement();
@@ -101,6 +103,11 @@
 void Model::finalize(void)
 {
-  this->importToGL ();
+  // this creates the display List.
+  this->importToDisplayList();
   
+
+  // deletes everything we allocated.
+  if (this->type == MODEL_DISPLAY_LIST)
+    this->deleteArrays();
   this->cleanup();
 
@@ -248,11 +255,8 @@
 
 /**
-   \brief finalizes an Model.
-   This funcion is needed, to delete all the Lists, and arrays that are no more needed because they are already imported into openGL. This will be applied at the end of the importing Process.
-*/
-bool Model::cleanup(void)
-{
-  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
-
+   \brief deletes all the arrays
+*/
+bool Model::deleteArrays(void)
+{
   if (this->vertices)
     delete this->vertices;
@@ -261,5 +265,16 @@
   if (this->normals)
     delete this->normals;
-
+  this->vertices = NULL;
+  this->vTexture = NULL;
+  this->normals = NULL;
+}
+
+/**
+   \brief finalizes an Model.
+   This funcion is needed, to delete all the Lists, and arrays that are no more needed because they are already imported into openGL. This will be applied at the end of the importing Process.
+*/
+bool Model::cleanup(void)
+{
+  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
   this->cleanupGroup(this->firstGroup);
   return true; 
@@ -703,7 +718,6 @@
    \brief reads and includes the Faces/Materials into the openGL state Machine
 */
-bool Model::importToGL (void)
-{
-
+bool Model::importToDisplayList(void)
+{
   // finalize the Arrays
   this->vertices->finalizeArray();
@@ -794,4 +808,23 @@
 
 /**
+   \brief reads and includes the Faces/Materials into the openGL state Machine
+*/
+bool Model::importToVertexArray(void)
+{
+  // finalize the Arrays
+  this->vertices->finalizeArray();
+  this->vTexture->finalizeArray();
+  if (normals->getCount() == 0) // vertices-Array must be built for this
+    this->buildVertexNormals();
+  this->normals->finalizeArray();
+
+  this->currentGroup = this->firstGroup;
+
+
+}
+
+
+
+/**
    \brief Adds a Face-element (one vertex of a face) with all its information. 
    \param elem The FaceElement to add to the OpenGL-environment.
Index: /orxonox/trunk/src/lib/graphics/importer/model.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/importer/model.h	(revision 3915)
+++ /orxonox/trunk/src/lib/graphics/importer/model.h	(revision 3916)
@@ -14,7 +14,12 @@
 template<class T> class tList;
 
+//! an enumerator fot the different Model Types.
+/**
+   MODEL_DISPLAY_LIST means, that a DisplayList will be built out of the model. This model will be STATIC, meaning it cannot be changed after initialisation.
+   MODEL_VERTEX_ARRAY means, that a VertexArray will be built out of the model. This moel will be DYNAMIX, meaning that one can change the properties from outside of the model.
+*/
+typedef enum MODEL_TYPE {MODEL_DISPLAY_LIST,
+			 MODEL_VERTEX_ARRAY};
 
-
-using namespace std;
 
 // definition of different modes for setting up Faces
@@ -23,5 +28,5 @@
 #define TEXCOORD 2     //!< If Faces are created WITH TextureCoordinate
 //! an enumerator for VERTEX_FORMAT
-enum VERTEX_FORMAT {VERTEX_ONLY = VERTEX,
+typedef enum VERTEX_FORMAT {VERTEX_ONLY = VERTEX,
 		    VERTEX_NORMAL = NORMAL,
 		    VERTEX_TEXCOORD = TEXCOORD,
@@ -70,4 +75,5 @@
 
   char* name;            //!< This is the name of the Model.
+  MODEL_TYPE type;
   bool finalized;        //!< Sets the Object to be finalized.
 
@@ -81,4 +87,7 @@
   int groupCount;       //!< The Count of Groups.
 
+  tList<Material>* materialList;
+  
+
   bool initGroup(Group* group);
   bool initFace (Face* face);
@@ -86,7 +95,10 @@
   bool buildVertexNormals(void);
 
-  bool importToGL(void);
+  bool importToDisplayList(void);
   bool addGLElement(FaceElement* elem);
 
+  bool importToVertexArray(void);
+
+  bool deleteArrays(void);
   bool cleanup(void);
   bool cleanupGroup(Group* group);
@@ -94,5 +106,4 @@
   bool cleanupFaceElement(FaceElement* faceElem);
 
-  tList<Material>* materialList;
 
  protected:
@@ -104,5 +115,5 @@
 
  public:
-  Model(const char* modelName = NULL);
+  Model(const char* modelName = NULL, MODEL_TYPE type = MODEL_DISPLAY_LIST);
   virtual ~Model(void);
 
Index: /orxonox/trunk/src/lib/graphics/importer/objModel.cc
===================================================================
--- /orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 3915)
+++ /orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 3916)
@@ -32,5 +32,5 @@
    \param scaling The factor that the model will be scaled with.
 */
-OBJModel::OBJModel(char* fileName, float scaling)
+OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName)
 {
   this->initializeOBJ();
@@ -72,5 +72,5 @@
    \param fileName The file to import
 */
-bool OBJModel::importFile (char* fileName)
+bool OBJModel::importFile (const char* fileName)
 {
   PRINTF(4)("preparing to read in file: %s\n", fileName);
@@ -84,5 +84,6 @@
   char pathSplitter='/';
 #endif /* __WIN32__ */
-  char* tmpName = fileName;
+  char* tmpName;
+  strcpy(tmpName, fileName);
   if (tmpName[0] == pathSplitter)
     tmpName++;
@@ -191,5 +192,5 @@
 
 */
-bool OBJModel::readMtlLib (char* mtlFile)
+bool OBJModel::readMtlLib (const char* mtlFile)
 {
   this->mtlFileName = new char [strlen(mtlFile)+1];
Index: /orxonox/trunk/src/lib/graphics/importer/objModel.h
===================================================================
--- /orxonox/trunk/src/lib/graphics/importer/objModel.h	(revision 3915)
+++ /orxonox/trunk/src/lib/graphics/importer/objModel.h	(revision 3916)
@@ -13,5 +13,5 @@
 {
  public:
-  OBJModel(char* fileName, float scaling = 1.0);
+  OBJModel(const char* fileName, float scaling = 1.0);
   virtual ~OBJModel();
   void initializeOBJ(void);
@@ -24,7 +24,7 @@
 
   ///// readin /////
-  bool importFile (char* fileName);
+  bool importFile (const char* fileName);
   bool readFromObjFile (void);
-  bool readMtlLib (char* matFile);
+  bool readMtlLib (const char* matFile);
 };
 
