Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2008, 9:17:30 PM (16 years ago)
Author:
rgrieder
Message:

started implementing the GameStates. Not much for now, but most of the Orxonox.cc code has been copied to GSRoot, GSGraphics and GSLevel.
There is no level currently, but the main menu is shown. This is more of an svn save because I would really like to have Member ConsoleCommands.

Location:
code/branches/gui/src/orxonox
Files:
9 added
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/orxonox/Main.cc

    r1660 r1661  
    4545#include "Settings.h"
    4646#include "Orxonox.h"
     47
     48#include "gamestates/GSRoot.h"
     49#include "gamestates/GSGraphics.h"
     50#include "gamestates/GSLevel.h"
     51#include "gamestates/GSGUI.h"
    4752
    4853using namespace orxonox;
     
    140145    state2->addChild(state3);
    141146    state2->addChild(state5);
    142     state3->addChild(state1);
    143147    state6->addChild(state2);
     148
     149    state6->removeChild("state2");
    144150
    145151    state5->requestState("state3");
     
    160166    COUT(2) << std::endl;*/
    161167
     168
     169    GSRoot root;
     170    GSGraphics graphics;
     171    GSLevel level;
     172    GSGUI gui;
     173
     174    root.addChild(&graphics);
     175    graphics.addChild(&level);
     176    graphics.addChild(&gui);
     177
     178    root.requestState("gui");
     179    root.tick(0.0f);
     180    root.requestState("");
    162181
    163182
     
    169188        orxonoxInstance.start(macBundlePath());
    170189#else
    171         orxonoxInstance.start();
     190        //orxonoxInstance.start();
    172191#endif
    173192    }
  • code/branches/gui/src/orxonox/Orxonox.cc

    r1656 r1661  
    4343//****** OGRE ******
    4444#include <OgreFrameListener.h>
    45 #include <OgreOverlay.h>
    46 #include <OgreOverlayManager.h>
    4745#include <OgreRoot.h>
    4846#include <OgreTimer.h>
  • code/branches/gui/src/orxonox/gui/GUIManager.cc

    r1659 r1661  
    8484
    8585        if (backgroundSceneManager_)
     86        {
     87            // We have to make sure the SceneManager is not anymore referenced.
     88            // For the case that the target SceneManager was yet another one, it
     89            // wouldn't matter anyway since this is the destructor.
     90            guiRenderer_->setTargetSceneManager(0);
    8691            Ogre::Root::getSingleton().destroySceneManager(backgroundSceneManager_);
     92        }
    8793
    8894        InputManager::getInstance().destroyState("gui");
     
    218224        {
    219225            if (state_ == OnDisplay)
    220                 _hideGUI();
     226                hideGUI();
    221227
    222228            COUT(3) << "Loading GUI " << name << std::endl;
     
    264270    }
    265271
    266     void GUIManager::_hideGUI()
     272    void GUIManager::hideGUI()
    267273    {
    268274        if (this->state_ != OnDisplay)
  • code/branches/gui/src/orxonox/gui/GUIManager.h

    r1653 r1661  
    7171        }
    7272        void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export
    73         void _hideGUI(); // tolua_export
     73        void hideGUI(); // tolua_export
    7474
    7575        Ogre::Camera* getCamera() { return this->backgroundCamera_; }
Note: See TracChangeset for help on using the changeset viewer.