- Timestamp:
- Feb 2, 2006, 10:31:56 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/event/event_handler.cc
r6813 r6990 260 260 this->eventsGrabbed = grabEvents; 261 261 if(!grabEvents) 262 { 263 SDL_ShowCursor(SDL_ENABLE); 262 264 SDL_WM_GrabInput(SDL_GRAB_OFF); 263 else 265 } 266 else 267 { 264 268 SDL_WM_GrabInput(SDL_GRAB_ON); 269 SDL_ShowCursor(SDL_DISABLE); 270 } 265 271 } 266 272 -
trunk/src/lib/graphics/graphics_engine.cc
r6980 r6990 429 429 430 430 /** 431 *432 * @param show if The mouse-cursor should be visible433 */434 void GraphicsEngine::showMouse(bool show)435 {436 if (show)437 SDL_ShowCursor(SDL_ENABLE);438 else439 SDL_ShowCursor(SDL_DISABLE);440 }441 442 /**443 *444 * @returns The Visinility of the mouse-cursor (true if visible, false if it is invisible)445 */446 bool GraphicsEngine::isMouseVisible()447 {448 if (SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE)449 return true;450 else451 return false;452 }453 454 /**455 *456 * @param steal If the Winodow-Managers Events should be stolen to this app457 * (steals the mouse, and all WM-clicks)458 *459 * This only happens, if the HARD-Debug-level is set to 0,1,2, because otherwise a Segfault could460 * result in the loss of System-controll461 */462 void GraphicsEngine::stealWMEvents(bool steal)463 {464 #if DEBUG < 3465 if (steal)466 SDL_WM_GrabInput(SDL_GRAB_ON);467 else468 SDL_WM_GrabInput(SDL_GRAB_OFF);469 #endif470 }471 472 /**473 *474 * @returns true if Events are stolen from the WM, false if not.475 */476 bool GraphicsEngine::isStealingEvents()477 {478 if (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON)479 return true;480 else481 return false;482 };483 431 484 432 /** -
trunk/src/lib/graphics/graphics_engine.h
r6979 r6990 56 56 57 57 int resolutionChanged(const SDL_ResizeEvent& resizeInfo); 58 59 static void showMouse(bool show);60 static bool isMouseVisible();61 static void stealWMEvents(bool steal);62 static bool isStealingEvents();63 58 64 59 static void enter2DMode(); -
trunk/src/lib/graphics/render2D/element_2d.cc
r6878 r6990 141 141 142 142 LoadParam(root, "bind-node", this, Element2D, setBindNode) 143 .describe("sets a node, this 2D-Element should be shown upon (name of the node)"); 143 .describe("sets a node, this 2D-Element should be shown upon (name of the node)") 144 .defaultValues(1, NULL); 144 145 145 146 LoadParam(root, "visibility", this, Element2D, setVisibility) -
trunk/src/world_entities/creatures/md2_creature.cc
r6986 r6990 106 106 107 107 PRINTF(4)("MD2CREATURE INIT\n"); 108 109 EventHandler::getInstance()->grabEvents(true);110 108 111 109 this->mouseDirX *= Quaternion( M_PI * 0.75f, Vector(0,1,0)); -
trunk/src/world_entities/weapons/crosshair.cc
r6807 r6990 48 48 if (this->material) 49 49 delete this->material; 50 51 // delete what has to be deleted here52 53 GraphicsEngine::showMouse(true);54 GraphicsEngine::stealWMEvents(false);55 50 } 56 51 … … 73 68 74 69 // center the mouse on the screen, and also hide the cursors 75 SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);70 /* SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); 76 71 GraphicsEngine::showMouse(false); 77 GraphicsEngine::stealWMEvents(true); 78 SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); 72 SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);*/ 79 73 } 80 74
Note: See TracChangeset
for help on using the changeset viewer.