Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4831 in orxonox.OLD for orxonox/trunk/src


Ignore:
Timestamp:
Jul 11, 2005, 5:44:41 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: hiding the mouse through the graphicsEngine

Location:
orxonox/trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/graphics_engine.cc

    r4830 r4831  
    7575    return -1;
    7676  this->initVideo(640, 480, 16);
    77   this->isInit = true;
    7877}
    7978
  • orxonox/trunk/src/lib/graphics/graphics_engine.h

    r4817 r4831  
    3434
    3535    void setWindowName(const char* windowName, const char* icon);
    36     int setGLattribs();
     36
    3737    int setResolution(int width, int height, int bpp);
    3838    void setFullscreen(bool fullscreen = false);
    3939    static void setBackgroundColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha = 1.0);
     40
    4041
    4142    /** \returns the x resolution */
     
    4748
    4849    int resolutionChanged(const SDL_ResizeEvent& resizeInfo);
     50
     51
     52    static void showMouse(bool show) { (show)?SDL_ShowCursor(SDL_ENABLE):SDL_ShowCursor(SDL_DISABLE); };
     53    static bool isMouseVisible() {return (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE)?true:false; };
     54    static void stealWMEvents(bool steal) { (steal)?SDL_WM_GrabInput(SDL_GRAB_ON):SDL_WM_GrabInput(SDL_GRAB_OFF); };
    4955
    5056    static void enter2DMode();
     
    6975    GraphicsEngine();
    7076    int initVideo(unsigned int resX, unsigned int resY, unsigned int bbp);
     77    int setGLattribs();
    7178
    7279  public:
  • orxonox/trunk/src/story_entities/world.cc

    r4830 r4831  
    10541054      GarbageCollector::getInstance()->tick(this->dtS);
    10551055
     1056
    10561057      /** actualy the Graphics Engine should tick the world not the other way around...
    10571058         but since we like the things not too complicated we got it this way around
  • orxonox/trunk/src/world_entities/weapons/crosshair.cc

    r4830 r4831  
    6363  EventHandler::getInstance()->subscribe(this, ES_GAME, EV_MOUSE_MOTION);
    6464
     65  // center the mouse on the screen, and also hide the cursors
     66  SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
     67  GraphicsEngine::showMouse(false);
     68  GraphicsEngine::stealWMEvents(true);
    6569}
    6670
     
    7579  // delete what has to be deleted here
    7680  EventHandler::getInstance()->unsubscribe(this);
     81
     82  GraphicsEngine::showMouse(true);
     83  GraphicsEngine::stealWMEvents(false);
    7784}
    7885
     
    182189             pos, pos+1, pos+2 );
    183190
    184   printf("%d %d %d\n", (int)pos[0], (int)pos[1], (int)pos[2]);
    185   this->rotation += 5;
     191  this->rotation += 1;
    186192
    187193  glTranslatef(position2D[0], position2D[1], 0);
  • orxonox/trunk/src/world_entities/weapons/weapon.h

    r4830 r4831  
    6969/**
    7070 * This is used as a container for all the different kinds of weapons that may exist
    71  * Animations/Sounds/etc. will be handled in the Extensions of this class.
    7271 */
    7372class Weapon : public WorldEntity
     
    122121  float                times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState
    123122  SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction
    124 
     123  Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
    125124
    126125
     
    130129
    131130 private:
    132   bool                 enabled;                          //<! states if the weapon is enabled or not
    133   Projectile*          projectile;                       //<! the projectile used for this weapon
     131   WeaponState          state;                           //!< The state this weapon is in.
     132   bool                 enabled;                         //<! states if the weapon is enabled or not
     133   Projectile*          projectile;                      //<! the projectile used for this weapon
    134134  //WeaponSound sound;
    135135};
Note: See TracChangeset for help on using the changeset viewer.