comparison src/video/cocoa/SDL_cocoamouse.m @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents 59ff7a2beb57
children 3e69e077cb95
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
74 point.x = point.x - bounds.x; 74 point.x = point.x - bounds.x;
75 point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - bounds.y; 75 point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - bounds.y;
76 if (point.x < 0 || point.x >= candidate->w || 76 if (point.x < 0 || point.x >= candidate->w ||
77 point.y < 0 || point.y >= candidate->h) { 77 point.y < 0 || point.y >= candidate->h) {
78 /* The mouse is out of this fullscreen display */ 78 /* The mouse is out of this fullscreen display */
79 if (mouse->focus == candidate->id) { 79 if (mouse->focus == candidate) {
80 SDL_SetMouseFocus(data->mouse, 0); 80 SDL_SetMouseFocus(data->mouse, 0);
81 } 81 }
82 } else { 82 } else {
83 /* This is it! */ 83 /* This is it! */
84 window = candidate; 84 window = candidate;
89 if (!window) { 89 if (!window) {
90 return; 90 return;
91 } 91 }
92 92
93 /* Set the focus appropriately */ 93 /* Set the focus appropriately */
94 if (mouse->focus != window->id) { 94 if (mouse->focus != window) {
95 SDL_SetMouseFocus(data->mouse, window->id); 95 SDL_SetMouseFocus(data->mouse, window);
96 } 96 }
97 97
98 switch ([event type]) { 98 switch ([event type]) {
99 case NSLeftMouseDown: 99 case NSLeftMouseDown:
100 case NSOtherMouseDown: 100 case NSOtherMouseDown: