comparison src/video/wincommon/SDL_sysmouse.c @ 13:e30a8ce27c22

Fixed double-mouse event bug on Windows using OpenGL
author Sam Lantinga <slouken@lokigames.com>
date Sun, 29 Apr 2001 23:00:03 +0000
parents 74212992fb08
children e8157fcb3114
comparison
equal deleted inserted replaced
12:34d956b20f75 13:e30a8ce27c22
190 int WIN_ShowWMCursor(_THIS, WMcursor *cursor) 190 int WIN_ShowWMCursor(_THIS, WMcursor *cursor)
191 { 191 {
192 POINT mouse_pos; 192 POINT mouse_pos;
193 193
194 /* The fullscreen cursor must be done in software with DirectInput */ 194 /* The fullscreen cursor must be done in software with DirectInput */
195 if ( !this->screen || DIRECTX_FULLSCREEN() ) { 195 if ( !this->screen || DDRAW_FULLSCREEN() ) {
196 return(0); 196 return(0);
197 } 197 }
198 198
199 /* Set the window cursor to our cursor, if applicable */ 199 /* Set the window cursor to our cursor, if applicable */
200 if ( cursor != NULL ) { 200 if ( cursor != NULL ) {
211 211
212 void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y) 212 void WIN_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
213 { 213 {
214 POINT pt; 214 POINT pt;
215 215
216 if ( DIRECTX_FULLSCREEN() ) { 216 if ( DDRAW_FULLSCREEN() ) {
217 x += (this->screen->offset % this->screen->pitch) / 217 x += (this->screen->offset % this->screen->pitch) /
218 this->screen->format->BytesPerPixel; 218 this->screen->format->BytesPerPixel;
219 y += (this->screen->offset / this->screen->pitch); 219 y += (this->screen->offset / this->screen->pitch);
220 SDL_PrivateMouseMotion(0, 0, x, y); 220 SDL_PrivateMouseMotion(0, 0, x, y);
221 } else if ( mouse_relative) { 221 } else if ( mouse_relative) {
235 void WIN_UpdateMouse(_THIS) 235 void WIN_UpdateMouse(_THIS)
236 { 236 {
237 RECT rect; 237 RECT rect;
238 POINT pt; 238 POINT pt;
239 239
240 if ( ! DIRECTX_FULLSCREEN() ) { 240 if ( ! DDRAW_FULLSCREEN() ) {
241 GetClientRect(SDL_Window, &rect); 241 GetClientRect(SDL_Window, &rect);
242 GetCursorPos(&pt); 242 GetCursorPos(&pt);
243 MapWindowPoints(NULL, SDL_Window, &pt, 1); 243 MapWindowPoints(NULL, SDL_Window, &pt, 1);
244 if (PtInRect(&rect, pt) && (WindowFromPoint(pt) == SDL_Window)){ 244 if (PtInRect(&rect, pt) && (WindowFromPoint(pt) == SDL_Window)){
245 SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS); 245 SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);