Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2008, 9:23:30 PM (16 years ago)
Author:
landauf
Message:

merged console-branch back to trunk.
IMPORTANT: update your media directory!

you need TCL to compile. TCL is available here: http://www.tcl.tk/
another option is to check out https://svn.orxonox.net/ogre/tcl8.5.2/ and compile it by yourself. makefiles are in the 'macosx', 'unix' and 'win' subfolders.
FindTCL.cmake searches in the usual locations and in ../libs/tcl8.5.2/

the orxonox console can be activated with numpad-enter. whatever you enter will be parsed by TCL. if TCL doesn't know a command, it gets executed by orxonox.

simple tcl commands are: "puts text" to write "text" into the console, "expr 1+1" to calculate the result of the given expression. just try it by yourself with "puts [expr 1+1]".
[x] means: evaluate x and use the returnvalue as an argument. in this case the returned value is "2" and the resulting command therefore "puts 2".

you can combine orxonox and tcl commands. a simple orxonox command is "log text" that writes text into the console and the logfile. test it with "log [expr 1+1]" to write "2" into all output channels of orxonox. something more advanced: "log [clock seconds]" writes the seconds since 1970 into the logfile. feel free to combine both: "log [clock seconds]: 1+1 is [expr 1+1]"

TCL uses variables. to set a new variable, use "set varname value". you can use the variable wherever you want with $varname. with this we can make the above command a bit more elegant:
set myexpression 1+1
log [clock seconds]: $myexpression is [expr $myexpression]

read more about tcl in the wiki: http://wiki.tcl.tk/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/GraphicsEngine.cc

    r1090 r1214  
    4040#include <OgreLogManager.h>
    4141#include <OgreTextureManager.h>
    42 #include <OgreRenderWindow.h>
    43 
     42#include "core/InputManager.h"
    4443#include "core/CoreIncludes.h"
    4544#include "core/ConfigValueIncludes.h"
    4645#include "core/Debug.h"
     46#include "core/TclBind.h"
    4747
    4848
     
    9090  {
    9191    COUT(4) << "*** GraphicsEngine: Destroying objects..." << std::endl;
     92    Ogre::WindowEventUtilities::removeWindowEventListener(this->renderWindow_, this);
    9293    if (this->root_)
    9394      delete this->root_;
     
    112113    SetConfigValue(ogreLogLevelNormal_  , 4).description("Corresponding orxonox debug level for ogre Normal");
    113114    SetConfigValue(ogreLogLevelCritical_, 2).description("Corresponding orxonox debug level for ogre Critical");
     115
     116    TclBind::getInstance().setDataPath(this->dataPath_);
    114117  }
    115118
     
    184187  {
    185188    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
     189    Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, this);
    186190    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    187191    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
     
    289293        << "*** Ogre: " << message << std::endl;
    290294  }
     295
     296    void GraphicsEngine::windowMoved(Ogre::RenderWindow *rw){
     297        int w = rw->getWidth();
     298        int h = rw->getHeight();
     299        InputManager::getSingleton().setWindowExtents(w, h);
     300    }
     301
     302    void GraphicsEngine::windowResized(Ogre::RenderWindow *rw){
     303        int w = rw->getWidth();
     304        int h = rw->getHeight();
     305        InputManager::getSingleton().setWindowExtents(w, h);
     306    }
     307
     308    void GraphicsEngine::windowFocusChanged(Ogre::RenderWindow *rw){
     309        int w = rw->getWidth();
     310        int h = rw->getHeight();
     311        InputManager::getSingleton().setWindowExtents(w, h);
     312    }
    291313}
Note: See TracChangeset for help on using the changeset viewer.