Window creation: Difference between revisions
Content added Content deleted
(→SDL: Quit on a SDL_QUIT event too.) |
(→SDL: Simplify with enum based on uint8 type for SDL events that maps events to Lisp symbols.) |
||
Line 2,046: | Line 2,046: | ||
(typedef SDL_Surface (cptr SDL_Surface)) |
(typedef SDL_Surface (cptr SDL_Surface)) |
||
(typedef SDL_EventType (enumed uint8 SDL_EventType |
|||
(SDL_KEYUP 3) |
|||
(SDL_QUIT 12))) |
|||
(typedef SDL_Event (union SD_Event |
(typedef SDL_Event (union SD_Event |
||
(type |
(type SDL_EventType) |
||
(pad (array 8 uint32)))) |
|||
(defvarl SDL_KEYUP 3) |
|||
(defvarl SDL_QUIT 12) |
|||
(with-dyn-lib "libSDL.so" |
(with-dyn-lib "libSDL.so" |
||
Line 2,070: | Line 2,072: | ||
(SDL_SetVideoMode 800 600 16 (logior SDL_SWSURFACE SDL_HWPALETTE)) |
(SDL_SetVideoMode 800 600 16 (logior SDL_SWSURFACE SDL_HWPALETTE)) |
||
(let ((e (make-union (ffi SDL_Event)))) |
(let ((e (make-union (ffi SDL_Event)))) |
||
(until* (memql (union-get e 'type) |
(until* (memql (union-get e 'type) '(SDL_KEYUP SDL_QUIT)) |
||
(SDL_WaitEvent e)))) |
(SDL_WaitEvent e)))) |
||
(SDL_Quit))</lang> |
(SDL_Quit))</lang> |