Mercurial > sdl-ios-xcode
diff src/video/bwindow/SDL_sysmouse.cc @ 3878:678576473849 SDL-1.2
Fixed bug #286
Date: Thu, 9 Feb 2006 17:06:51 +0300
From: "Oleg K [BeSman]"
Subject: BeOS SDL patches
Hello all. My name is Oleg K. [BeSman], Im a BeOS user from Russia.This mail
contain a BeOs-specific patches to SDL (implementation of InputGrabbing and
mouse_relative mode). See the source in attached file for details.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 24 Sep 2006 15:31:42 +0000 |
parents | 376665398b25 |
children | c82c1870c77a |
line wrap: on
line diff
--- a/src/video/bwindow/SDL_sysmouse.cc Sun Sep 24 01:27:40 2006 +0000 +++ b/src/video/bwindow/SDL_sysmouse.cc Sun Sep 24 15:31:42 2006 +0000 @@ -27,7 +27,7 @@ #include "SDL_BWin.h" extern "C" { - +#include "SDL_cursor_c.h" #include "SDL_sysmouse_c.h" /* Convert bits to padded bytes */ @@ -128,11 +128,26 @@ /* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */ void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y) { + if (_this->screen && (_this->screen->flags & SDL_FULLSCREEN) ) { + SDL_PrivateMouseMotion(0, 0, x, y); + } else { BPoint pt(x, y); SDL_Win->Lock(); SDL_Win->ConvertToScreen(&pt); SDL_Win->Unlock(); set_mouse_position((int32)pt.x, (int32)pt.y); + } +} +/* Check to see if we need to enter or leave mouse relative mode */ +void BE_CheckMouseMode(_THIS) +{ + /* If the mouse is hidden and input is grabbed, we use relative mode */ + if ( !(SDL_cursorstate & CURSOR_VISIBLE) && + (_this->input_grab != SDL_GRAB_OFF) ) { + mouse_relative = 1; + } else { + mouse_relative = 0; + } } }; /* Extern C */