Changeset 1641 for code/branches/gui/src/orxonox
- Timestamp:
- Jul 22, 2008, 9:16:35 PM (16 years ago)
- Location:
- code/branches/gui/src/orxonox
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/GraphicsEngine.cc
r1640 r1641 22 22 * Author: 23 23 * Reto Grieder 24 * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 24 25 * Co-authors: 25 * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007,Felix Schulthess26 * Felix Schulthess 26 27 * 27 28 */ … … 89 90 RegisterObject(GraphicsEngine); 90 91 92 assert(singletonRef_s == 0); 91 93 singletonRef_s = this; 92 94 … … 305 307 //Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); 306 308 307 // create a full screen viewport in which to render the scene and the loading screen 308 // The GUI uses its own one to be able to render on top of everything. 309 // That explains why the Z order here is only 1 and not 0 (top most) 310 this->viewport_ = this->renderWindow_->addViewport(0, 1); 309 // create a full screen viewport 310 this->viewport_ = this->renderWindow_->addViewport(0, 0); 311 311 312 312 return true; -
code/branches/gui/src/orxonox/GraphicsEngine.h
r1640 r1641 22 22 * Author: 23 23 * Reto Grieder 24 * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007 24 25 * Co-authors: 25 * Benjamin Knecht <beni_at_orxonox.net>, (C) 2007,Felix Schulthess26 * Felix Schulthess 26 27 * 27 28 */ … … 88 89 89 90 static GraphicsEngine& getSingleton(); 90 static GraphicsEngine* getSingletonPtr() { return &getSingleton(); }91 static GraphicsEngine* getSingletonPtr() { return singletonRef_s; } 91 92 92 93 private: -
code/branches/gui/src/orxonox/Orxonox.cc
r1640 r1641 300 300 } 301 301 302 void Orxonox::loadGame(const std::string& name)302 /*static*/ void Orxonox::loadGame(const std::string& name) 303 303 { 304 304 const GameMode& mode = Settings::getGameMode(name); -
code/branches/gui/src/orxonox/gui/GUIManager.h
r1640 r1641 103 103 104 104 void tickInput(float dt) { } 105 void tickKey(float dt) { } 106 void tickMouse(float dt) { } 105 107 106 108 void loadScenes(); -
code/branches/gui/src/orxonox/gui/OgreCEGUIRenderer.cpp
r1638 r1641 191 191 // GUI (uses its own viewport to be able render on top of all viewports). 192 192 // But since we don't use overlays in the GUI, it doesn't matter. 193 //if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty()) 194 if (!d_quadlist.empty()) 193 // ORXONOX REVERT: Changes are not in place anymore, but might be in the future! 194 if (d_render_sys->_getViewport()->getOverlaysEnabled() && !d_quadlist.empty()) 195 //if (!d_quadlist.empty()) 195 196 { 196 197 /// Quad list needs to be sorted and thus the vertex buffer rebuilt. If not, we can … … 493 494 // GUI (uses its own viewport to be able render on top of all viewports). 494 495 // But since we don't use overlays in the GUI, it doesn't matter. 495 //if (d_render_sys->_getViewport()->getOverlaysEnabled()) 496 if (true) 496 // ORXONOX REVERT: Changes are not in place anymore, but might be in the future! 497 if (d_render_sys->_getViewport()->getOverlaysEnabled()) 498 //if (true) 497 499 { 498 500 z = -1 + z; -
code/branches/gui/src/orxonox/overlays/console/InGameConsole.cc
r1638 r1641 46 46 #include "core/ConsoleCommand.h" 47 47 #include "core/input/InputManager.h" 48 #include "core/input/SimpleInputState.h" 49 #include "core/input/InputBuffer.h" 48 50 #include "GraphicsEngine.h" 49 51 … … 66 68 , consoleOverlayBorder_(0) 67 69 , consoleOverlayTextAreas_(0) 68 , emptySceneManager_(0)69 , emptyCamera_(0)70 , viewport_(0)71 70 { 72 71 RegisterObject(InGameConsole); … … 118 117 void InGameConsole::initialise() 119 118 { 119 // create the corresponding input state 120 InputManager::createSimpleInputState("console", 40)->setKeyHandler(Shell::getInstance().getInputBuffer()); 121 120 122 // create overlay and elements 121 123 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); … … 195 197 Shell::getInstance().addOutputLevel(true); 196 198 197 // create a sceneManager in order to render in our own viewport198 this->emptySceneManager_ = Ogre::Root::getSingleton()199 .createSceneManager(Ogre::ST_GENERIC, "Console/EmptySceneManager");200 this->emptyCamera_ = this->emptySceneManager_->createCamera("Console/EmptyCamera");201 this->viewport_ = GraphicsEngine::getSingleton().getRenderWindow()->addViewport(emptyCamera_, 10);202 this->viewport_->setOverlaysEnabled(true);203 this->viewport_->setClearEveryFrame(false);204 205 199 COUT(4) << "Info: InGameConsole initialized" << std::endl; 206 200 } … … 211 205 void InGameConsole::destroy() 212 206 { 207 this->deactivate(); 208 209 // destroy the input state previously created 210 SimpleInputState * inputState = dynamic_cast<SimpleInputState*>(InputManager::getState("console")); 211 if (inputState) 212 InputManager::destroyState("console"); 213 213 214 Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr(); 214 215 if (ovMan) … … 467 468 if (output.size() > this->maxCharsPerLine_) 468 469 { 469 if (Shell::getInstance().getInputBuffer() .getCursorPosition() < this->inputWindowStart_)470 this->inputWindowStart_ = Shell::getInstance().getInputBuffer() .getCursorPosition();471 else if (Shell::getInstance().getInputBuffer() .getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))472 this->inputWindowStart_ = Shell::getInstance().getInputBuffer() .getCursorPosition() - this->maxCharsPerLine_ + 1;470 if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_) 471 this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition(); 472 else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1)) 473 this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1; 473 474 474 475 output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_); -
code/branches/gui/src/orxonox/overlays/console/InGameConsole.h
r1638 r1641 100 100 Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_; 101 101 102 Ogre::SceneManager* emptySceneManager_; //!< dummy SceneManager to render overlays in empty windows103 Ogre::Camera* emptyCamera_; //!< dummy camera to render overlays in empty windows104 Ogre::Viewport* viewport_;105 106 102 // config values 107 103 float relativeWidth;
Note: See TracChangeset
for help on using the changeset viewer.