--- /dev/null
+USING: kernel parser sequences io ;
+[
+ "/library/sdl/sdl.factor"
+ "/library/sdl/sdl-video.factor"
+ "/library/sdl/sdl-event.factor"
+ "/library/sdl/sdl-gfx.factor"
+ "/library/sdl/sdl-keysym.factor"
+ "/library/sdl/sdl-keyboard.factor"
+ "/library/sdl/sdl-ttf.factor"
+ "/library/sdl/sdl-utils.factor"
+] [
+ dup print run-resource
+] each
] repeat
] repeat drop ; inline
+: must-lock-surface? ( surface -- ? )
+ #! This is a macro in SDL_video.h.
+ dup sdl-surface-offset 0 = [
+ sdl-surface-flags
+ SDL_HWSURFACE SDL_ASYNCBLIT bitor SDL_RLEACCEL bitor
+ bitand 0 = not
+ ] [
+ drop t
+ ] ifte ;
+
: with-surface ( quot -- )
#! Execute a quotation, locking the current surface if it
#! is required (eg, hardware surface).
] ifte SDL_Flip drop
] with-scope ; inline
-: must-lock-surface? ( surface -- ? )
- #! This is a macro in SDL_video.h.
- dup sdl-surface-offset 0 = [
- sdl-surface-flags
- SDL_HWSURFACE SDL_ASYNCBLIT bitor SDL_RLEACCEL bitor
- bitand 0 = not
- ] [
- drop t
- ] ifte ;
-
: sdl-surface-rect ( x y surface -- rect )
dup sdl-surface-w swap sdl-surface-h make-rect ;
END-STRUCT
BEGIN-STRUCT: sdl-surface
- FIELD: uint flags
- FIELD: format* format
- FIELD: int w
- FIELD: int h
- FIELD: ushort pitch
- FIELD: void* pixels
- FIELD: int offset
- FIELD: void* hwdata
- FIELD: short clip-x
- FIELD: short clip-y
- FIELD: ushort clip-w
- FIELD: ushort clip-h
- FIELD: uint unused1
- FIELD: uint locked
- FIELD: int map
- FIELD: uint format_version
- FIELD: int refcount
+ FIELD: uint flags
+ FIELD: sdl-format* format
+ FIELD: int w
+ FIELD: int h
+ FIELD: ushort pitch
+ FIELD: void* pixels
+ FIELD: int offset
+ FIELD: void* hwdata
+ FIELD: short clip-x
+ FIELD: short clip-y
+ FIELD: ushort clip-w
+ FIELD: ushort clip-h
+ FIELD: uint unused1
+ FIELD: uint locked
+ FIELD: int map
+ FIELD: uint format_version
+ FIELD: int refcount
END-STRUCT
: SDL_VideoInit ( driver-name flags -- )