Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8324 in orxonox.OLD for trunk/src/lib/gui/gl/glgui_handler.cc


Ignore:
Timestamp:
Jun 12, 2006, 12:40:57 AM (18 years ago)
Author:
bensch
Message:

trunk: Texture-Sequence is initialized smoothly now in the GLGuiCursor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl/glgui_handler.cc

    r8312 r8324  
    4242    EventHandler::getInstance()->withUNICODE(ES_ALL, true );
    4343
    44     this->cursor = NULL;
     44    this->_cursor = NULL;
    4545    for (unsigned int i = 0; i < EV_NUMBER; i++)
    4646    {
     
    6464  void GLGuiHandler::activateCursor()
    6565  {
    66     if (this->cursor == NULL)
    67       this->cursor = new GLGuiCursor();
    68     this->cursor->show();
    69     this->cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
     66    if (this->_cursor == NULL)
     67      this->_cursor = new GLGuiCursor();
     68    this->_cursor->show();
     69    this->_cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY()));
    7070  }
    7171
    7272  void GLGuiHandler::deactivateCursor(bool deleteCursor)
    7373  {
    74     if (this->cursor)
     74    if (this->_cursor)
    7575    {
    7676      if (deleteCursor)
    77         delete this->cursor;
    78       this->cursor = NULL;
     77        delete this->_cursor;
     78      this->_cursor = NULL;
    7979    }
    8080  }
     
    108108            if (GLGuiWidget::focused()->clickable())
    109109            {
    110               Vector2D cursorPos = (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
     110              Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
    111111              GLGuiWidget::focused()->click(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
    112112            }
     
    116116            if (GLGuiWidget::focused()->clickable())
    117117            {
    118               Vector2D cursorPos = (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
     118              Vector2D cursorPos = (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(event.x, event.y);
    119119              GLGuiWidget::focused()->release(cursorPos - GLGuiWidget::focused()->getAbsCoor2D());
    120120            }
     
    128128
    129129      case EV_VIDEO_RESIZE:
    130         if (this->cursor != NULL)
    131           this->cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));
     130        if (this->_cursor != NULL)
     131          this->_cursor->setMaxBorders(Vector2D(event.resize.w, event.resize.h));
    132132        break;
    133133    }
     
    147147  Vector2D GLGuiHandler::cursorPositionOverFocusedWidget() const
    148148  {
    149     return (this->cursor != NULL) ? this->cursor->getAbsCoor2D() : Vector2D(0,0);
     149    return (this->_cursor != NULL) ? this->_cursor->getAbsCoor2D() : Vector2D(0,0);
    150150  }
    151151
    152152  const Vector2D& GLGuiHandler::cursorPositionAbs() const
    153153  {
    154     if (this->cursor)
    155       return this->cursor->getAbsCoor2D();
     154    if (this->_cursor)
     155      return this->_cursor->getAbsCoor2D();
    156156    else
    157157      return Vector2D::nullVector();
     
    160160  {
    161161    assert (widget != NULL);
    162     if (this->cursor)
    163       return  this->cursor->getAbsCoor2D() - widget->getAbsCoor2D();
     162    if (this->_cursor)
     163      return  this->_cursor->getAbsCoor2D() - widget->getAbsCoor2D();
    164164    else
    165165      return Vector2D::nullVector();
     
    179179    const std::list<BaseObject*>* objects = ClassList::getList(CL_GLGUI_WIDGET);
    180180
    181     if (objects != NULL && this->cursor != NULL)
     181    if (objects != NULL && this->_cursor != NULL)
    182182    {
    183183      for (std::list<BaseObject*>::const_iterator it = objects->begin(); it != objects->end(); it++)
     
    187187        if (widget->isVisible() &&
    188188            widget->focusable() &&
    189             widget->focusOverWidget(this->cursor))
     189            widget->focusOverWidget(this->_cursor))
    190190        {
    191191          // receiving Focus
Note: See TracChangeset for help on using the changeset viewer.