Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 2:14:09 PM (15 years ago)
Author:
bknecht
Message:

(Doxygen) Documentation added for GUIManager and some GameState classes.

File:
1 edited

Legend:

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

    r2869 r2875  
    2222 *   Author:
    2323 *      Reto Grieder
     24 *      Benjamin Knecht
    2425 *   Co-authors:
    25  *      Benjamin Knecht
     26 *
    2627 *
    2728 */
     
    7576    }
    7677
     78    /**
     79    @brief
     80        Deconstructor of the GUIManager
     81
     82        Basically shuts down CEGUI and destroys the Lua engine and afterwards the interface to the Ogre engine.
     83    */
    7784    GUIManager::~GUIManager()
    7885    {
     
    96103    }
    97104
     105    /**
     106    @brief
     107        Initialises the GUIManager by starting up CEGUI
     108    @param renderWindow
     109        Ogre's render window. Without this, the GUI cannot be displayed.
     110    @return true if success, otherwise false
     111
     112        Before this call the GUIManager won't do anything, but can be accessed.
     113
     114        Creates the interface to Ogre, sets up the CEGUI renderer and the Lua script module together with the Lua engine.
     115        The log is set up and connected to the CEGUILogger.
     116        After Lua setup tolua++-elements are linked to Lua-state to give Lua access to C++-code.
     117        Finally initial Lua code is executed (maybe we can do this with the CEGUI startup script automatically).
     118    */
    98119    bool GUIManager::initialise(Ogre::RenderWindow* renderWindow)
    99120    {
     
    151172    }
    152173
     174    /**
     175    @brief
     176        Calls main Lua script
     177    @todo
     178        Replace loadGUI.lua with loadGUI_2.lua after merging this back to trunk.
     179        However CEGUI is able to execute a startup script. We could maybe put this call in this startup code.
     180
     181        This function calls the main Lua script for our GUI.
     182
     183        Additionally we set the datapath variable in Lua. This is needed so Lua can access the data used for the GUI.
     184    */
    153185    void GUIManager::loadLuaCode()
    154186    {
    155187        try
    156188        {
     189            // call main Lua script
    157190            this->scriptModule_->executeScriptFile("loadGUI_2.lua", "GUI");
     191            // set datapath for GUI data
    158192            lua_pushfstring(this->scriptModule_->getLuaState(), Core::getMediaPathString().c_str());
    159193            lua_setglobal(this->scriptModule_->getLuaState(), "datapath");
     
    170204    }
    171205
     206    /**
     207    @brief
     208        used to tick the GUI
     209    @param time
     210        clock which provides time value for the GUI System
     211
     212        Ticking the GUI means updating it with a certain regularity.
     213        The elapsed time since the last call is given in the time value provided by the clock.
     214        This time value is then used to provide a fluent animation of the GUI.
     215    */
    172216    void GUIManager::update(const Clock& time)
    173217    {
     
    176220    }
    177221
     222    /**
     223    @brief
     224        Executes Lua code
     225    @param str
     226        reference to string object holding the Lua code which is to be executed
     227
     228        This function gives total access to the GUI. You can execute ANY Lua code here.
     229    */
    178230    void GUIManager::executeCode(const std::string& str)
    179231    {
     
    181233    }
    182234
     235    /**
     236    @brief
     237        Tells the GUIManager which SceneManager to use
     238    @param camera
     239        The current camera on which the GUI should be displayed on.
     240
     241        In fact the GUIManager needs the SceneManager and not the Camera to display the GUI.
     242        This means the GUI is not bound to a camera but rather to the SceneManager.
     243        Hidding the GUI when needed can therefore not be solved by just NOT setting the current camera.
     244    */
    183245    void GUIManager::setCamera(Ogre::Camera* camera)
    184246    {
     
    186248    }
    187249
     250    /**
     251    @brief
     252        Debug function to give CEGUI the possibility to output on our console
     253    @param
     254        String to be displaed in CEGUI's name
     255
     256        This function should be removed as it only provides a quick (and dirty) possibility to access the output on the console.
     257        CEGUI's output should be put into the cegui.log using the CEGUI Logger.
     258    */
    188259    void GUIManager::testOutput(std::string& str)
    189260    {
     
    191262    }
    192263
     264    /**
     265    @brief
     266        Displays specified GUI on screen
     267    @param name
     268        The name of the GUI
     269
     270        The function executes the Lua function with the same name in case the GUIManager is ready.
     271        For more details check out loadGUI_2.lua where the function presides.
     272    */
    193273    void GUIManager::showGUI(const std::string& name)
    194274    {
     
    215295    }
    216296
     297    /**
     298    @brief
     299        Function receiving a mouse button pressed event.
     300    @param id
     301        ID of the mouse button which got pressed
     302
     303        This function is inherited by MouseHandler and injects the event into CEGUI.
     304        It is for CEGUI to process the event.
     305    */
    217306    void GUIManager::mouseButtonPressed(MouseButtonCode::ByEnum id)
    218307    {
     
    228317    }
    229318
     319    /**
     320    @brief
     321        Function receiving a mouse button released event.
     322    @param id
     323        ID of the mouse button which got released
     324
     325        This function is inherited by MouseHandler and injects the event into CEGUI.
     326        It is for CEGUI to process the event.
     327    */
    230328    void GUIManager::mouseButtonReleased(MouseButtonCode::ByEnum id)
    231329    {
     
    241339    }
    242340
    243 
     341    /**
     342    @brief
     343        converts mouse event code to CEGUI event code
     344    @param button
     345        code of the mouse button as we use it in Orxonox
     346    @return
     347        code of the mouse button as it is used by CEGUI
     348
     349        Simple convertion from mouse event code in Orxonox to the one used in CEGUI.
     350     */
    244351    inline CEGUI::MouseButton GUIManager::convertButton(MouseButtonCode::ByEnum button)
    245352    {
Note: See TracChangeset for help on using the changeset viewer.