Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6990 in orxonox.OLD for trunk/src/lib/graphics/graphics_engine.cc


Ignore:
Timestamp:
Feb 2, 2006, 10:31:56 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: better mouse capture now

File:
1 edited

Legend:

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

    r6980 r6990  
    429429
    430430/**
    431  *
    432  * @param show if The mouse-cursor should be visible
    433  */
    434 void GraphicsEngine::showMouse(bool show)
    435 {
    436   if (show)
    437     SDL_ShowCursor(SDL_ENABLE);
    438   else
    439     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   else
    451     return false;
    452 }
    453 
    454 /**
    455  *
    456  * @param steal If the Winodow-Managers Events should be stolen to this app
    457  * (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 could
    460  * result in the loss of System-controll
    461  */
    462 void GraphicsEngine::stealWMEvents(bool steal)
    463 {
    464 #if DEBUG < 3
    465   if (steal)
    466     SDL_WM_GrabInput(SDL_GRAB_ON);
    467   else
    468     SDL_WM_GrabInput(SDL_GRAB_OFF);
    469 #endif
    470 }
    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   else
    481     return false;
    482 };
    483431
    484432/**
Note: See TracChangeset for help on using the changeset viewer.