Window creation: Difference between revisions

→‎SDL: Simplify with enum based on uint8 type for SDL events that maps events to Lisp symbols.
(→‎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:
 
(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
(type uint8SDL_EventType)
(pad (array 8 uint32))))
 
(defvarl SDL_KEYUP 3)
(defvarl SDL_QUIT 12)
 
(with-dyn-lib "libSDL.so"
Line 2,070 ⟶ 2,072:
(SDL_SetVideoMode 800 600 16 (logior SDL_SWSURFACE SDL_HWPALETTE))
(let ((e (make-union (ffi SDL_Event))))
(until* (memql (union-get e 'type) ^'(,SDL_KEYUP ,SDL_QUIT))
(SDL_WaitEvent e))))
(SDL_Quit))</lang>
543

edits