Changeset 3143
- Timestamp:
- Jun 10, 2009, 10:54:43 PM (15 years ago)
- Location:
- code/branches/pch/src/orxonox/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/orxonox/gui/GUIManager.cc
r3110 r3143 24 24 * Benjamin Knecht 25 25 * Co-authors: 26 * 26 * ... 27 27 * 28 28 */ 29 29 30 30 /** 31 32 33 31 @file 32 @brief 33 Implementation of the GUIManager class. 34 34 */ 35 35 36 36 #include "GUIManager.h" 37 37 38 #include <boost/filesystem/path.hpp> 39 #include < OgreRenderWindow.h>40 #include <CEGUI.h> 38 extern "C" { 39 #include <lua.h> 40 } 41 41 #include <CEGUIDefaultLogger.h> 42 #include <CEGUIExceptions.h> 43 #include <CEGUIInputEvent.h> 44 #include <CEGUIResourceProvider.h> 45 #include <CEGUISystem.h> 42 46 #include <ogreceguirenderer/OgreCEGUIRenderer.h> 47 43 48 #include "SpecialConfig.h" // Configures the macro below 44 49 #ifdef CEGUILUA_USE_INTERNAL_LIBRARY … … 49 54 50 55 #include "util/Exception.h" 51 #include "core/ConsoleCommand.h"52 56 #include "core/Core.h" 53 57 #include "core/Clock.h" … … 56 60 #include "core/Loader.h" 57 61 58 extern "C" {59 #include <lua.h>60 }61 62 62 namespace orxonox 63 63 { 64 static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button); 64 65 GUIManager* GUIManager::singletonRef_s = 0; 65 66 … … 139 140 140 141 // Create our own logger to specify the filepath 141 boost::filesystem::path ceguiLogFilepath(Core::getLogPath() / "cegui.log");142 142 this->ceguiLogger_ = new DefaultLogger(); 143 this->ceguiLogger_->setLogFilename( ceguiLogFilepath.string());143 this->ceguiLogger_->setLogFilename(Core::getLogPathString() + "cegui.log"); 144 144 // set the log level according to ours (translate by subtracting 1) 145 145 this->ceguiLogger_->setLoggingLevel( … … 340 340 } 341 341 342 void GUIManager::keyPressed(const KeyEvent& evt) 343 { 344 guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); 345 } 346 void GUIManager::keyReleased(const KeyEvent& evt) 347 { 348 guiSystem_->injectKeyUp(evt.key); 349 } 350 342 351 /** 343 352 @brief … … 382 391 COUT(1) << ex.getMessage() << std::endl; 383 392 } 393 } 394 395 void GUIManager::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 396 { 397 guiSystem_->injectMouseMove(rel.x, rel.y); 398 } 399 void GUIManager::mouseScrolled(int abs, int rel) 400 { 401 guiSystem_->injectMouseWheelChange(rel); 384 402 } 385 403 … … 394 412 Simple convertion from mouse event code in Orxonox to the one used in CEGUI. 395 413 */ 396 inline CEGUI::MouseButton GUIManager::convertButton(MouseButtonCode::ByEnum button)414 static inline CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button) 397 415 { 398 416 switch (button) -
code/branches/pch/src/orxonox/gui/GUIManager.h
r3008 r3143 22 22 * Author: 23 23 * Reto Grieder 24 * Benjamin Knecht 24 25 * Co-authors: 25 * Benjamin Knecht26 * ... 26 27 * 27 28 */ 28 29 29 30 /** 30 @file 31 @brief Declaration of the GUIManager class. 31 @file 32 @brief 33 Declaration of the GUIManager class. 32 34 */ 33 35 … … 36 38 37 39 #include "OrxonoxPrereqs.h" 40 41 #include <map> 42 #include <string> 38 43 #include <OgrePrerequisites.h> 39 44 #include <CEGUIForwardRefs.h> 40 #include <CEGUIInputEvent.h> 41 #include <CEGUISystem.h> 45 42 46 #include "core/input/InputInterfaces.h" 43 #include <map>44 #include "overlays/GUIOverlay.h"45 47 46 48 // Forward declaration … … 105 107 106 108 // keyHandler functions 107 void keyPressed (const KeyEvent& evt) 108 { guiSystem_->injectKeyDown(evt.key); guiSystem_->injectChar(evt.text); } 109 void keyReleased(const KeyEvent& evt) 110 { guiSystem_->injectKeyUp(evt.key); } 109 void keyPressed (const KeyEvent& evt); 110 void keyReleased(const KeyEvent& evt); 111 111 void keyHeld (const KeyEvent& evt) { } 112 112 … … 115 115 void mouseButtonReleased(MouseButtonCode::ByEnum id); 116 116 void mouseButtonHeld (MouseButtonCode::ByEnum id) { } 117 void mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) 118 { guiSystem_->injectMouseMove(rel.x, rel.y); } 119 void mouseScrolled (int abs, int rel) 120 { guiSystem_->injectMouseWheelChange(rel);} 117 void mouseMoved (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize); 118 void mouseScrolled (int abs, int rel); 121 119 122 120 void updateInput(float dt) { } 123 121 void updateKey (float dt) { } 124 122 void updateMouse(float dt) { } 125 126 static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);127 123 128 124 Ogre::RenderWindow* renderWindow_; //!< Ogre's render window to give CEGUI access to it
Note: See TracChangeset
for help on using the changeset viewer.