Changeset 57
- Timestamp:
- 10/03/07 14:24:27 (1 year ago)
- Files:
-
- trunk/luigi/examples/example1_sdl.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/luigi/examples/example1_sdl.d
r42 r57 451 451 continue; 452 452 } 453 453 454 switch(event.type) { 454 455 case SDL_VIDEORESIZE: 455 screen = SDL_SetVideoMode(event.resize.w, event.resize.h, 16, 456 SDL_OPENGL|SDL_RESIZABLE); 457 if ( screen ) { 458 reshape(screen.w, screen.h); 459 } else { 460 /* Uh oh, we couldn't set the new video mode?? */; 461 } 456 screen.w = event.resize.w; 457 screen.h = event.resize.h; 458 reshape(screen.w,screen.h); 462 459 break; 463 460 … … 467 464 468 465 case SDL_KEYDOWN: 469 if (event.key.keysym.sym == SDLK_ESCAPE) { 470 done = 1; 466 with (event.key) { 467 if (keysym.sym == SDLK_ESCAPE || 468 (keysym.sym == SDLK_q && (keysym.mod & KMOD_CTRL))) 469 { 470 done = 1; 471 } 471 472 } 473 break; 474 475 case SDL_MOUSEBUTTONDOWN: 476 // Click on the non-gui area -- steal focus from gui. 477 gui.set_focus(null); 472 478 break; 473 479 … … 478 484 } 479 485 480 if (!gui.get_focus()) 486 if (!gui.get_focus()) 481 487 { 482 488 Uint8 *keys = SDL_GetKeyState(null);
