Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
3877:81f66f258d77 | 3878:678576473849 |
---|---|
25 #include <GameKit.h> | 25 #include <GameKit.h> |
26 | 26 |
27 #include "SDL_BWin.h" | 27 #include "SDL_BWin.h" |
28 | 28 |
29 extern "C" { | 29 extern "C" { |
30 | 30 #include "SDL_cursor_c.h" |
31 #include "SDL_sysmouse_c.h" | 31 #include "SDL_sysmouse_c.h" |
32 | 32 |
33 /* Convert bits to padded bytes */ | 33 /* Convert bits to padded bytes */ |
34 #define PADDED_BITS(bits) ((bits+7)/8) | 34 #define PADDED_BITS(bits) ((bits+7)/8) |
35 | 35 |
126 } | 126 } |
127 | 127 |
128 /* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */ | 128 /* Implementation by Christian Bauer <cbauer@student.physik.uni-mainz.de> */ |
129 void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y) | 129 void BE_WarpWMCursor(_THIS, Uint16 x, Uint16 y) |
130 { | 130 { |
131 if (_this->screen && (_this->screen->flags & SDL_FULLSCREEN) ) { | |
132 SDL_PrivateMouseMotion(0, 0, x, y); | |
133 } else { | |
131 BPoint pt(x, y); | 134 BPoint pt(x, y); |
132 SDL_Win->Lock(); | 135 SDL_Win->Lock(); |
133 SDL_Win->ConvertToScreen(&pt); | 136 SDL_Win->ConvertToScreen(&pt); |
134 SDL_Win->Unlock(); | 137 SDL_Win->Unlock(); |
135 set_mouse_position((int32)pt.x, (int32)pt.y); | 138 set_mouse_position((int32)pt.x, (int32)pt.y); |
139 } | |
140 } | |
141 /* Check to see if we need to enter or leave mouse relative mode */ | |
142 void BE_CheckMouseMode(_THIS) | |
143 { | |
144 /* If the mouse is hidden and input is grabbed, we use relative mode */ | |
145 if ( !(SDL_cursorstate & CURSOR_VISIBLE) && | |
146 (_this->input_grab != SDL_GRAB_OFF) ) { | |
147 mouse_relative = 1; | |
148 } else { | |
149 mouse_relative = 0; | |
150 } | |
136 } | 151 } |
137 | 152 |
138 }; /* Extern C */ | 153 }; /* Extern C */ |