Index: /trunk/src/defs/class_id.h
===================================================================
--- /trunk/src/defs/class_id.h	(revision 5365)
+++ /trunk/src/defs/class_id.h	(revision 5366)
@@ -111,4 +111,5 @@
   CL_NULL_ELEMENT_2D            =    0x00000f22,
   CL_SHELL_BUFFER               =    0x00000f32,
+  CL_GLGUI_HANDLER              =    0x00000f40,
 
 
Index: /trunk/src/defs/sdlincl.h
===================================================================
--- /trunk/src/defs/sdlincl.h	(revision 5365)
+++ /trunk/src/defs/sdlincl.h	(revision 5366)
@@ -1,7 +1,7 @@
 /*!
-  \file sdlincl.h
-  \brief This file includes sdl Headers.
-
-  no Class is defined here, but the SDL Headers
+ * @file sdlincl.h
+ * This file includes sdl Headers.
+ *
+ * no Class is defined here, but the SDL Headers
 */
 
@@ -9,5 +9,11 @@
 #define _SDLINCL_H
 
+#include "confincl.h"
+
+#ifdef HAVE_SDL_H
+#include <SDL.h>
+#else
 #include <SDL/SDL.h>
+#endif
 
 #endif /* _SDLINCL_H */
Index: /trunk/src/lib/event/event.h
===================================================================
--- /trunk/src/lib/event/event.h	(revision 5365)
+++ /trunk/src/lib/event/event.h	(revision 5366)
@@ -2,13 +2,9 @@
  * @file event.h
  * an abstract event
- *
- * @todo remove HUGE class-overhead. This could also be a struct
-*/
+ */
 
 #ifndef _EVENT_H
 #define _EVENT_H
 
-
-//#include "base_object.h"
 #include "sdlincl.h"
 
Index: /trunk/src/lib/graphics/graphics_engine.h
===================================================================
--- /trunk/src/lib/graphics/graphics_engine.h	(revision 5365)
+++ /trunk/src/lib/graphics/graphics_engine.h	(revision 5366)
@@ -71,5 +71,5 @@
     bool hwSupportsEXT(const char* extension);
 
-    /** \brief swaps the GL_BUFFERS */
+    /** @brief swaps the GL_BUFFERS */
     inline static void swapBuffers() { SDL_GL_SwapBuffers(); };
 
Index: /trunk/src/lib/gui/gl_gui/Makefile.am
===================================================================
--- /trunk/src/lib/gui/gl_gui/Makefile.am	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/Makefile.am	(revision 5366)
@@ -10,4 +10,5 @@
 
 libORXglgui_a_SOURCES = glmenu/glmenu_imagescreen.cc \
+			glgui_handler.cc \
                         glgui_widget.cc \
                         glgui_button.cc \
Index: /trunk/src/lib/gui/gl_gui/Makefile.in
===================================================================
--- /trunk/src/lib/gui/gl_gui/Makefile.in	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/Makefile.in	(revision 5366)
@@ -55,4 +55,5 @@
 libORXglgui_a_LIBADD =
 am_libORXglgui_a_OBJECTS = libORXglgui_a-glmenu_imagescreen.$(OBJEXT) \
+	libORXglgui_a-glgui_handler.$(OBJEXT) \
 	libORXglgui_a-glgui_widget.$(OBJEXT) \
 	libORXglgui_a-glgui_button.$(OBJEXT) \
@@ -70,4 +71,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/libORXglgui_a-glgui_container.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/libORXglgui_a-glgui_frame.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/libORXglgui_a-glgui_handler.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/libORXglgui_a-glgui_pushbutton.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/libORXglgui_a-glgui_widget.Po \
@@ -198,4 +200,5 @@
 libORXglgui_a_CPPFLAGS = -DBUILD_ORXONOX
 libORXglgui_a_SOURCES = glmenu/glmenu_imagescreen.cc \
+			glgui_handler.cc \
                         glgui_widget.cc \
                         glgui_button.cc \
@@ -268,4 +271,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libORXglgui_a-glgui_container.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libORXglgui_a-glgui_frame.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libORXglgui_a-glgui_handler.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libORXglgui_a-glgui_pushbutton.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libORXglgui_a-glgui_widget.Po@am__quote@
@@ -304,4 +308,20 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libORXglgui_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libORXglgui_a-glmenu_imagescreen.obj `if test -f 'glmenu/glmenu_imagescreen.cc'; then $(CYGPATH_W) 'glmenu/glmenu_imagescreen.cc'; else $(CYGPATH_W) '$(srcdir)/glmenu/glmenu_imagescreen.cc'; fi`
+
+libORXglgui_a-glgui_handler.o: glgui_handler.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libORXglgui_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libORXglgui_a-glgui_handler.o -MD -MP -MF "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo" -c -o libORXglgui_a-glgui_handler.o `test -f 'glgui_handler.cc' || echo '$(srcdir)/'`glgui_handler.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo" "$(DEPDIR)/libORXglgui_a-glgui_handler.Po"; else rm -f "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='glgui_handler.cc' object='libORXglgui_a-glgui_handler.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/libORXglgui_a-glgui_handler.Po' tmpdepfile='$(DEPDIR)/libORXglgui_a-glgui_handler.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libORXglgui_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libORXglgui_a-glgui_handler.o `test -f 'glgui_handler.cc' || echo '$(srcdir)/'`glgui_handler.cc
+
+libORXglgui_a-glgui_handler.obj: glgui_handler.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libORXglgui_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libORXglgui_a-glgui_handler.obj -MD -MP -MF "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo" -c -o libORXglgui_a-glgui_handler.obj `if test -f 'glgui_handler.cc'; then $(CYGPATH_W) 'glgui_handler.cc'; else $(CYGPATH_W) '$(srcdir)/glgui_handler.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo" "$(DEPDIR)/libORXglgui_a-glgui_handler.Po"; else rm -f "$(DEPDIR)/libORXglgui_a-glgui_handler.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='glgui_handler.cc' object='libORXglgui_a-glgui_handler.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/libORXglgui_a-glgui_handler.Po' tmpdepfile='$(DEPDIR)/libORXglgui_a-glgui_handler.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libORXglgui_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libORXglgui_a-glgui_handler.obj `if test -f 'glgui_handler.cc'; then $(CYGPATH_W) 'glgui_handler.cc'; else $(CYGPATH_W) '$(srcdir)/glgui_handler.cc'; fi`
 
 libORXglgui_a-glgui_widget.o: glgui_widget.cc
Index: /trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_checkbutton.cc	(revision 5366)
@@ -16,5 +16,5 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
 
-#include "glgui_.h"
+#include "glgui_checkbutton.h"
 
 using namespace std;
@@ -23,5 +23,5 @@
  * standard constructor
 */
-GLGui::GLGui ()
+GLGuiCheckButton::GLGuiCheckButton ()
 {
   this->init();
@@ -33,5 +33,5 @@
  * standard deconstructor
 */
-GLGui::~GLGui()
+GLGuiCheckButton::~GLGuiCheckButton()
 {
 
@@ -41,14 +41,14 @@
  * initializes the GUI-element
  */
-GLGui::init()
+GLGuiCheckButton::init()
 {
-  this->setClassID(CL_GLGUI_, "GLGui");
+  this->setClassID(CL_GLGUI_CHECKBUTTON, "GLGuiCheckButton");
 
 }
 
 /**
- * draws the GLGui
+ * draws the GLGuiCheckButton
  */
-void GLGui::draw()
+void GLGuiCheckButton::draw()
 {
 
Index: /trunk/src/lib/gui/gl_gui/glgui_checkbutton.h
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_checkbutton.h	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_checkbutton.h	(revision 5366)
@@ -1,12 +1,12 @@
 /*!
- * @file glgui_.h
+ * @file glgui_checkbutton.h
  * The gl_ widget of th openglGUI
  *
  */
 
-#ifndef _GLGUI__H
+#ifndef _GLGUI_CHECKBUTTON_H
 #define _GLGUI__H
 
-#include "base_object.h"
+#include "glgui_button.h"
 
 // FORWARD DECLARATION
@@ -16,9 +16,9 @@
  *
  */
-class GLGui : public GLGui {
+class GLGuiCheckButton : public GLGuiButton {
 
  public:
-  GLGui();
-  virtual ~GLGui();
+  GLGuiCheckButton();
+  virtual ~GLGuiCheckButton();
 
   void init();
@@ -30,3 +30,3 @@
 };
 
-#endif /* _GLGUI__H */
+#endif /* _GLGUI_CHECKBUTTON_H */
Index: /trunk/src/lib/gui/gl_gui/glgui_handler.cc
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_handler.cc	(revision 5366)
@@ -10,5 +10,5 @@
 
    ### File Specific:
-   main-programmer: ...
+   main-programmer: Benjamin Grauer
    co-programmer: ...
 */
@@ -16,16 +16,15 @@
 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
 
-#include "proto_singleton.h"
+#include "glgui_handler.h"
 
 using namespace std;
-
 
 /**
  * standard constructor
  */
-ProtoSingleton::ProtoSingleton ()
+GLGuiHandler::GLGuiHandler ()
 {
-   this->setClassID(CL_PROTO_ID, "ProtoSingleton");
-   this->setName("ProtoSingleton");
+   this->setClassID(CL_GLGUI_HANDLER, "GLGuiHandler");
+   this->setName("GLGuiHandler");
 
    /* If you make a new class, what is most probably the case when you write this file
@@ -46,11 +45,11 @@
  *  the singleton reference to this class
  */
-ProtoSingleton* ProtoSingleton::singletonRef = NULL;
+GLGuiHandler* GLGuiHandler::singletonRef = NULL;
 
 /**
    @brief standard deconstructor
  */
-ProtoSingleton::~ProtoSingleton ()
+GLGuiHandler::~GLGuiHandler ()
 {
-  ProtoSingleton::singletonRef = NULL;
+  GLGuiHandler::singletonRef = NULL;
 }
Index: /trunk/src/lib/gui/gl_gui/glgui_handler.h
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_handler.h	(revision 5366)
@@ -4,6 +4,6 @@
 */
 
-#ifndef _PROTO_SINGLETON_H
-#define _PROTO_SINGLETON_H
+#ifndef _GLGUI_HANDLER_H
+#define _GLGUI_HANDLER_H
 
 #include "base_object.h"
@@ -12,15 +12,15 @@
 
 //! A default singleton class.
-class ProtoSingleton : public BaseObject {
+class GLGuiHandler : public BaseObject {
 
  public:
-  virtual ~ProtoSingleton(void);
+  virtual ~GLGuiHandler(void);
   /** @returns a Pointer to the only object of this Class */
-  inline static ProtoSingleton* getInstance(void) { if (!singletonRef) singletonRef = new ProtoSingleton();  return singletonRef; };
+  inline static GLGuiHandler* getInstance(void) { if (!singletonRef) singletonRef = new GLGuiHandler();  return singletonRef; };
 
  private:
-  ProtoSingleton(void);
-  static ProtoSingleton* singletonRef;
+  GLGuiHandler(void);
+  static GLGuiHandler* singletonRef;
 };
 
-#endif /* _PROTO_SINGLETON_H */
+#endif /* _GLGUI_HANDLER_H */
Index: /trunk/src/lib/gui/gl_gui/glgui_image.cc
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_image.cc	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_image.cc	(revision 5366)
@@ -16,5 +16,5 @@
 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GUI
 
-#include "glgui_.h"
+#include "glgui_image.h"
 
 using namespace std;
@@ -23,5 +23,5 @@
  * standard constructor
 */
-GLGui::GLGui ()
+GLGuiImage::GLGuiImage ()
 {
   this->init();
@@ -33,5 +33,5 @@
  * standard deconstructor
 */
-GLGui::~GLGui()
+GLGuiImage::~GLGuiImage()
 {
 
@@ -41,14 +41,14 @@
  * initializes the GUI-element
  */
-GLGui::init()
+void GLGuiImage::init()
 {
-  this->setClassID(CL_GLGUI_, "GLGui");
+  this->setClassID(CL_GLGUI_, "GLGuiImage");
 
 }
 
 /**
- * draws the GLGui
+ * draws the GLGuiImage
  */
-void GLGui::draw()
+void GLGuiImage::draw()
 {
 
Index: /trunk/src/lib/gui/gl_gui/glgui_image.h
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_image.h	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_image.h	(revision 5366)
@@ -1,10 +1,10 @@
 /*!
- * @file glgui_.h
- * The gl_ widget of th openglGUI
+ * @file glgui_image.h
+ * The gl_Image widget of th openglGUI
  *
  */
 
-#ifndef _GLGUI__H
-#define _GLGUI__H
+#ifndef _GLGUI_IMAGE_H
+#define _GLGUI_IMAGE_H
 
 #include "base_object.h"
@@ -12,13 +12,13 @@
 // FORWARD DECLARATION
 
-//! This is part of the openglGUI class
+//! This is Image part of the openglGUI class
 /**
  *
  */
-class GLGui : public GLGui {
+class GLGuiImage : public GLGuiWidget {
 
  public:
-  GLGui();
-  virtual ~GLGui();
+  GLGuiImage();
+  virtual ~GLGuiImage();
 
   void init();
@@ -30,3 +30,3 @@
 };
 
-#endif /* _GLGUI__H */
+#endif /* _GLGUI_IMAGE_H */
Index: /trunk/src/lib/gui/gl_gui/glgui_menu.cc
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_menu.cc	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_menu.cc	(revision 5366)
@@ -23,5 +23,5 @@
  * standard constructor
 */
-GLGui::GLGui ()
+GLGuiMenu::GLGuiMenu ()
 {
   this->init();
@@ -33,5 +33,5 @@
  * standard deconstructor
 */
-GLGui::~GLGui()
+GLGuiMenu::~GLGuiMenu()
 {
 
@@ -41,14 +41,14 @@
  * initializes the GUI-element
  */
-GLGui::init()
+void GLGuiMenu::init()
 {
-  this->setClassID(CL_GLGUI_, "GLGui");
+  this->setClassID(CL_GLGUI_MENU, "GLGuiMenu");
 
 }
 
 /**
- * draws the GLGui
+ * draws the GLGuiMenu
  */
-void GLGui::draw()
+void GLGuiMenu::draw()
 {
 
Index: /trunk/src/lib/gui/gl_gui/glgui_menu.h
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_menu.h	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_menu.h	(revision 5366)
@@ -1,10 +1,10 @@
 /*!
- * @file glgui_.h
- * The gl_ widget of th openglGUI
+ * @file glgui_menu.h
+ * The gl_Menu widget of th openglGUI
  *
  */
 
-#ifndef _GLGUI__H
-#define _GLGUI__H
+#ifndef _GLGUI_MENU_H
+#define _GLGUI_MENU_H
 
 #include "base_object.h"
@@ -12,13 +12,13 @@
 // FORWARD DECLARATION
 
-//! This is part of the openglGUI class
+//! This is Menu part of the openglGUI class
 /**
  *
  */
-class GLGui : public GLGui {
+class GLGuiMenu : public GLGuiMenu {
 
  public:
-  GLGui();
-  virtual ~GLGui();
+  GLGuiMenu();
+  virtual ~GLGuiMenu();
 
   void init();
@@ -30,3 +30,3 @@
 };
 
-#endif /* _GLGUI__H */
+#endif /* _GLGUI_MENU_H */
Index: /trunk/src/lib/gui/gl_gui/glgui_widget.cc
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_widget.cc	(revision 5366)
@@ -46,3 +46,9 @@
   this->setClassID(CL_GLGUI_WIDGET, "GLGuiWidget");
 
+  this->managed = false;
+  this->focusable = true;
+  this->clickable = true;
+
+  this->backGround = NULL;
+  this->renderModel = 0;
 }
Index: /trunk/src/lib/gui/gl_gui/glgui_widget.h
===================================================================
--- /trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 5365)
+++ /trunk/src/lib/gui/gl_gui/glgui_widget.h	(revision 5366)
@@ -1,6 +1,6 @@
 /*!
- * @file glgui_widget.h
- * The gl_widget of the openglGUI
- */
+* @file glgui_widget.h
+* The gl_widget of the openglGUI
+*/
 
 #ifndef _GLGUI_WIDGET_H
@@ -15,27 +15,29 @@
 //! This is part of the openglGUI class
 /**
- * A widget is the main class of all the elements of th GUI.
- */
+* A widget is the main class of all the elements of th GUI.
+*/
 class GLGuiWidget : public Element2D {
- public:
-  GLGuiWidget();
-  virtual ~GLGuiWidget();
+  public:
+    GLGuiWidget();
+    virtual ~GLGuiWidget();
 
-  void init();
+    void init();
 
-  void show();
-  void hide();
+    void show();
+    void hide();
 
 
-  virtual void draw() = 0;
-  virtual void update() = 0;
+    virtual void draw() = 0;
+    virtual void update() = 0;
 
- private:
-  bool                  managed;          //!< if this GUI-element should be managed. true means it gets deleted with the deletion of it's parent.
-  bool                  focusable;        //!< If it can receive focus.
-  bool                  clickable;        //!< if it can be clicked upon.
+  protected:
+    Material*             backGround;
+    GLuint                renderModel;
 
-  Material*             backGround;
-  GLuint                renderModel;
+  private:
+    bool                  managed;          //!< if this GUI-element should be managed. true means it gets deleted with the deletion of it's parent.
+    bool                  focusable;        //!< If it can receive focus.
+    bool                  clickable;        //!< if it can be clicked upon.
+
 
 
Index: /trunk/src/util/resource_manager.cc
===================================================================
--- /trunk/src/util/resource_manager.cc	(revision 5365)
+++ /trunk/src/util/resource_manager.cc	(revision 5366)
@@ -217,4 +217,6 @@
 BaseObject* ResourceManager::load(const char* fileName, ResourcePriority prio, void* param1, void* param2, void* param3)
 {
+  if (fileName == NULL)
+    return NULL;
   ResourceType tmpType;
 #ifndef NO_MODEL
@@ -284,4 +286,7 @@
                             void* param1, void* param2, void* param3)
 {
+  if (fileName == NULL)
+    return NULL;
+
   // searching if the resource was loaded before.
   Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2, param3);
@@ -320,5 +325,5 @@
           else
             {
-              PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
+              PRINTF(2)("File %s in %s does not exist. Loading a cube-Model instead\n", fileName, dataDir);
               tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
             }
@@ -461,13 +466,15 @@
 bool ResourceManager::unload(void* pointer, ResourcePriority prio)
 {
+  if (pointer == NULL)
+    return false;
   // if pointer is existent. and only one resource of this type exists.
   Resource* tmpResource = this->locateResourceByPointer(pointer);
-  if (tmpResource == NULL)
-    {
-      PRINTF(2)("Resource not Found %p\n", pointer);
-      return false;
-    }
-  else
+  if (tmpResource != NULL)
     return unload(tmpResource, prio);
+  else
+  {
+    PRINTF(2)("Resource not Found %p\n", pointer);
+    return false;
+  }
 }
 
