comparison src/video/qnxgf/SDL_gf_input.c @ 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 4b594623401b
children f7b03b6838cb
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
39 /* Mouse related functions */ 39 /* Mouse related functions */
40 SDL_Cursor *gf_createcursor(SDL_Surface * surface, int hot_x, int hot_y); 40 SDL_Cursor *gf_createcursor(SDL_Surface * surface, int hot_x, int hot_y);
41 int gf_showcursor(SDL_Cursor * cursor); 41 int gf_showcursor(SDL_Cursor * cursor);
42 void gf_movecursor(SDL_Cursor * cursor); 42 void gf_movecursor(SDL_Cursor * cursor);
43 void gf_freecursor(SDL_Cursor * cursor); 43 void gf_freecursor(SDL_Cursor * cursor);
44 void gf_warpmouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y); 44 void gf_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y);
45 void gf_freemouse(SDL_Mouse * mouse); 45 void gf_freemouse(SDL_Mouse * mouse);
46 46
47 /* HIDDI interacting functions */ 47 /* HIDDI interacting functions */
48 static int32_t hiddi_connect_devices(); 48 static int32_t hiddi_connect_devices();
49 static int32_t hiddi_disconnect_devices(); 49 static int32_t hiddi_disconnect_devices();
276 } 276 }
277 } else { 277 } else {
278 /* Sanity checks */ 278 /* Sanity checks */
279 window = SDL_GetWindowFromID(window_id); 279 window = SDL_GetWindowFromID(window_id);
280 if (window != NULL) { 280 if (window != NULL) {
281 display = SDL_GetDisplayFromWindow(window); 281 display = window->display;
282 if (display != NULL) { 282 if (display != NULL) {
283 didata = (SDL_DisplayData *) display->driverdata; 283 didata = (SDL_DisplayData *) display->driverdata;
284 if (didata == NULL) { 284 if (didata == NULL) {
285 return -1; 285 return -1;
286 } 286 }
397 } 397 }
398 } else { 398 } else {
399 /* Sanity checks */ 399 /* Sanity checks */
400 window = SDL_GetWindowFromID(window_id); 400 window = SDL_GetWindowFromID(window_id);
401 if (window != NULL) { 401 if (window != NULL) {
402 display = SDL_GetDisplayFromWindow(window); 402 display = window->display;
403 if (display != NULL) { 403 if (display != NULL) {
404 didata = (SDL_DisplayData *) display->driverdata; 404 didata = (SDL_DisplayData *) display->driverdata;
405 if (didata == NULL) { 405 if (didata == NULL) {
406 return; 406 return;
407 } 407 }
459 } 459 }
460 } 460 }
461 } 461 }
462 462
463 void 463 void
464 gf_warpmouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y) 464 gf_warpmouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
465 { 465 {
466 SDL_VideoDisplay *display; 466 SDL_VideoDisplay *display;
467 SDL_DisplayData *didata; 467 SDL_DisplayData *didata;
468 SDL_Window *window;
469 uint32_t xmax; 468 uint32_t xmax;
470 uint32_t ymax; 469 uint32_t ymax;
471 int32_t status; 470 int32_t status;
472 471
473 /* Sanity checks */ 472 /* Sanity checks */
474 window = SDL_GetWindowFromID(windowID);
475 if (window != NULL) { 473 if (window != NULL) {
476 display = SDL_GetDisplayFromWindow(window); 474 display = window->display;
477 if (display != NULL) { 475 if (display != NULL) {
478 didata = (SDL_DisplayData *) display->driverdata; 476 didata = (SDL_DisplayData *) display->driverdata;
479 if (didata == NULL) { 477 if (didata == NULL) {
480 return; 478 return;
481 } 479 }
493 if (y < 0) { 491 if (y < 0) {
494 y = 0; 492 y = 0;
495 } 493 }
496 494
497 /* Get window size to clamp maximum coordinates */ 495 /* Get window size to clamp maximum coordinates */
498 SDL_GetWindowSize(windowID, &xmax, &ymax); 496 SDL_GetWindowSize(window, &xmax, &ymax);
499 if (x >= xmax) { 497 if (x >= xmax) {
500 x = xmax - 1; 498 x = xmax - 1;
501 } 499 }
502 if (y >= ymax) { 500 if (y >= ymax) {
503 y = ymax - 1; 501 y = ymax - 1;