SDLApp
create
(Fn [(Ref String a), Int, Int] SDLApp)
(create title width height)
creates an SDLApp instance that can then be used by run-with-callbacks
.
default-draw
(Fn [a, (Ptr SDL_Renderer), b] ())
(default-draw app rend state-ref)
is a default rendering function that can be passed to run-with-callbacks
.
quit-on-esc
(Fn [(Ref SDLApp a), b, (Ref SDL_Event c)] b)
(quit-on-esc app state event)
is a default event handling function that can be passed to run-with-callbacks
. Allows the application to quit if the player presses the escape key.
renderer
(Fn [(Ref SDLApp a)] (Ref (Ptr SDL_Renderer) a))
gets the renderer
property of a SDLApp
.
run-with-callbacks
(Fn [(Ref SDLApp a), (Fn [(Ref SDLApp a), b, (Ref SDL_Event c)] b d), (Fn [b] b e), (Fn [(Ref SDLApp a), (Ptr SDL_Renderer), (Ref b f)] () e), b] ())
(run-with-callbacks app event-fn update-fn draw-fn initial-state)
starts the SDLApp and uses three callbacks to handle events, update state and render graphics.
set-renderer
(Fn [SDLApp, (Ptr SDL_Renderer)] SDLApp)
sets the renderer
property of a SDLApp
.
set-renderer!
(Fn [(Ref SDLApp a), (Ptr SDL_Renderer)] ())
sets the renderer
property of a SDLApp
in place.
set-window!
(Fn [(Ref SDLApp a), (Ptr SDL_Window)] ())
sets the window
property of a SDLApp
in place.
stop
(Fn [(Ref SDLApp a)] b)
(stop app)
stops the app. This function return 'a' to enable it to be called from anywhere.
update-fps
(Fn [SDLApp, (Ref (Fn [Int] Int a) b)] SDLApp)
updates the fps
property of a SDLApp
using a function f
.
update-renderer
(Fn [SDLApp, (Ref (Fn [(Ptr SDL_Renderer)] (Ptr SDL_Renderer) a) b)] SDLApp)
updates the renderer
property of a SDLApp
using a function f
.
update-window
(Fn [SDLApp, (Ref (Fn [(Ptr SDL_Window)] (Ptr SDL_Window) a) b)] SDLApp)
updates the window
property of a SDLApp
using a function f
.
window
(Fn [(Ref SDLApp a)] (Ref (Ptr SDL_Window) a))
gets the window
property of a SDLApp
.