Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 24, 2008, 1:12:31 PM (16 years ago)
Author:
rgrieder
Message:
  • AudioManager is now Tickable
  • NPC update moved to its tick-function
  • corrected CMakeLists
  • added a few window properties to GraphicsEngine
  • OrxListener has been completely replaced
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/orxonox/GraphicsEngine.cc

    r790 r919  
    3535#include <OgreConfigFile.h>
    3636#include <OgreTextureManager.h>
     37#include <OgreRenderWindow.h>
    3738
    3839#include "core/Debug.h"
     
    4950    this->configPath_ = "";
    5051    this->dataPath_ = "";
    51     scene_ = NULL;
     52    this->root_ = 0;
     53    this->scene_ = 0;
     54    this->renderWindow_ = 0;
    5255  }
    5356
     
    98101  {
    99102    root_->initialise(true, "OrxonoxV2");
     103    this->renderWindow_ = root_->getAutoCreatedWindow();
    100104    TextureManager::getSingleton().setDefaultNumMipmaps(5);
    101105    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     
    131135  }
    132136
     137  /**
     138    Returns the window handle of the render window.
     139    At least the InputHandler uses this to create the OIS::InputManager
     140    @return The window handle of the render window
     141  */
     142  size_t GraphicsEngine::getWindowHandle()
     143  {
     144    if (this->renderWindow_)
     145    {
     146      Ogre::RenderWindow *renderWindow = this->root_->getAutoCreatedWindow();
     147      size_t windowHnd = 0;
     148      renderWindow->getCustomAttribute("WINDOW", &windowHnd);
     149      return windowHnd;
     150    }
     151    else
     152      return 0;
     153  }
     154
     155  /**
     156    Get the width of the current render window
     157    @return The width of the current render window
     158  */
     159  int GraphicsEngine::getWindowWidth() const
     160  {
     161    if (this->renderWindow_)
     162    {
     163      return this->renderWindow_->getWidth();
     164    }
     165    else
     166      return 0;
     167  }
     168
     169  /**
     170    Get the height of the current render window
     171    @return The height of the current render window
     172  */
     173  int GraphicsEngine::getWindowHeight() const
     174  {
     175    if (this->renderWindow_)
     176    {
     177      return this->renderWindow_->getHeight();
     178    }
     179    else
     180      return 0;
     181  }
    133182
    134183}
Note: See TracChangeset for help on using the changeset viewer.