comparison test/testintersections.c @ 4465:3e69e077cb95

Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API. Plus, this lets me start implementing cursor support.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 09 May 2010 20:47:22 -0700
parents 64ce267332c6
children e743b9c3f6d6
comparison
equal deleted inserted replaced
4464:fa77a6429698 4465:3e69e077cb95
286 ++frames; 286 ++frames;
287 while (SDL_PollEvent(&event)) { 287 while (SDL_PollEvent(&event)) {
288 CommonEvent(state, &event, &done); 288 CommonEvent(state, &event, &done);
289 switch (event.type) { 289 switch (event.type) {
290 case SDL_MOUSEBUTTONDOWN: 290 case SDL_MOUSEBUTTONDOWN:
291 if (event.button.which == 0) { 291 mouse_begin_x = event.button.x;
292 mouse_begin_x = event.button.x; 292 mouse_begin_y = event.button.y;
293 mouse_begin_y = event.button.y;
294 }
295 break; 293 break;
296 case SDL_MOUSEBUTTONUP: 294 case SDL_MOUSEBUTTONUP:
297 if (event.button.which == 0) { 295 if (event.button.button == 3)
298 if (event.button.button == 3) 296 add_line(mouse_begin_x, mouse_begin_y, event.button.x,
299 add_line(mouse_begin_x, mouse_begin_y, event.button.x, 297 event.button.y);
300 event.button.y); 298 if (event.button.button == 1)
301 if (event.button.button == 1) 299 add_rect(mouse_begin_x, mouse_begin_y, event.button.x,
302 add_rect(mouse_begin_x, mouse_begin_y, event.button.x, 300 event.button.y);
303 event.button.y);
304 }
305 break; 301 break;
306 case SDL_KEYDOWN: 302 case SDL_KEYDOWN:
307 switch (event.key.keysym.sym) { 303 switch (event.key.keysym.sym) {
308 case 'l': 304 case 'l':
309 if (event.key.keysym.mod & KMOD_SHIFT) 305 if (event.key.keysym.mod & KMOD_SHIFT)