Changeset 7905 in orxonox.OLD for branches/gui/src/lib
- Timestamp:
- May 27, 2006, 2:48:11 PM (18 years ago)
- Location:
- branches/gui/src/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/event/event_def.h
r7903 r7905 28 28 EV_JOY_BUTTON, 29 29 30 EV_WINDOW_FOCUS, 30 31 EV_VIDEO_RESIZE, 31 32 -
branches/gui/src/lib/event/event_handler.cc
r7903 r7905 388 388 ev.type = EV_JOY_BUTTON; 389 389 break; 390 case SDL_ACTIVEEVENT: 391 ev.type = EV_WINDOW_FOCUS; 392 ev.bPressed = (event.active.gain != 0); 393 break; 390 394 case SDL_VIDEORESIZE: 391 395 ev.resize = event.resize; -
branches/gui/src/lib/gui/gl_gui/glgui_cursor.cc
r7891 r7905 33 33 34 34 this->subscribeEvent(ES_MENU, EV_MOUSE_MOTION); 35 this->subscribeEvent(ES_MENU, EV_WINDOW_FOCUS); 35 36 36 37 … … 73 74 this->backMaterial().setDiffuse(color.x, color.y, color.z); 74 75 75 //if (this->movement != Vector2D())76 if (this->movement != Vector2D()) 76 77 { 77 /*if (this->getAbsCoor2D().x < 0.0 )78 if (this->getAbsCoor2D().x < 0.0 ) 78 79 movement.x = -this->getAbsCoor2D().x; 79 if (this->getAbsCoor2D().x > 200.0)80 movement.x = ( 200.0-this->getAbsCoor2D().x);80 if (this->getAbsCoor2D().x > this->_maxBorders.x) 81 movement.x = (this->_maxBorders.x-this->getAbsCoor2D().x); 81 82 if (this->getAbsCoor2D().y < 0.0 ) 82 movement. x= -this->getAbsCoor2D().y;83 if (this->getAbsCoor2D().y > 200.0)84 movement. x = (200.0-this->getAbsCoor2D().y);*/83 movement.y = -this->getAbsCoor2D().y; 84 if (this->getAbsCoor2D().y > this->_maxBorders.y) 85 movement.y = (this->_maxBorders.y-this->getAbsCoor2D().y); 85 86 87 newPos += movement; 86 88 87 88 //this->shiftCoor2D(movement);89 89 this->setAbsCoor2D(newPos); 90 90 movement = Vector2D(); … … 106 106 switch (event.type) 107 107 { 108 case EV_WINDOW_FOCUS: 109 if (event.bPressed) 110 { 111 int mouseX, mouseY; 112 SDL_GetMouseState(&mouseX, &mouseY); 113 newPos = Vector2D(mouseX, mouseY); 114 } 115 break; 108 116 case EV_MOUSE_MOTION: 109 newPos = Vector2D(event.x, event.y); 110 movement += Vector2D(event.xRel * _mouseSensitivity, event.yRel * _mouseSensitivity); 117 // newPos = Vector2D(event.x, event.y); 118 movement += Vector2D((float)event.xRel * _mouseSensitivity, (float)event.yRel * _mouseSensitivity); 119 movement.debug(); 111 120 break; 112 121 -
branches/gui/src/lib/gui/gl_gui/glgui_cursor.h
r7891 r7905 30 30 static float mouseSensitivity() { return GLGuiCursor::_mouseSensitivity; }; 31 31 32 void setMaxBorders(const Vector2D& maxBorders) { this->_maxBorders = maxBorders; }; 33 32 34 void init(); 33 35 const Vector2D& position() const { return Element2D::getAbsCoor2D(); } … … 38 40 virtual void process(const Event& event); 39 41 private: 42 43 Vector2D _maxBorders; 40 44 41 45 Vector2D newPos; -
branches/gui/src/lib/gui/gl_gui/glgui_handler.cc
r7903 r7905 24 24 #include "class_list.h" 25 25 26 27 /// TAKE THIS OUT OF HERE. 28 #include "graphics_engine.h" 26 29 27 30 namespace OrxGui … … 64 67 this->cursor = new GLGuiCursor(); 65 68 this->cursor->show(); 69 this->cursor->setMaxBorders(Vector2D(GraphicsEngine::getInstance()->getResolutionX(), GraphicsEngine::getInstance()->getResolutionY())); 66 70 } 67 71
Note: See TracChangeset
for help on using the changeset viewer.