raylib/core
src/raylib/core.tur
defn
init-window
(init-window [width :int height :int title :cstr] :void)
create the window and initialize the OpenGL context.
Parameters
| width | window width in pixels | |
| height | window height in pixels | |
| title | window title string |
Example
(init-window 800 600 "My Game")
Since: P3
defn
close-window
(close-window :void)
close the window and free the OpenGL context.
Example
(close-window)
Since: P3
defn
window-should-close
(window-should-close :bool)
return true if the user requested window close.
Returns
true if ESC was pressed or the close button was clicked.
Example
(while (not (window-should-close)) ...)
Since: P3
defn
begin-drawing
(begin-drawing :void)
start a new frame; must be paired with end-drawing.
Example
(begin-drawing)
Since: P3
defn
end-drawing
(end-drawing :void)
end the frame and present the backbuffer.
Example
(end-drawing)
Since: P3
defn
begin-mode-3d
(begin-mode-3d [camera :int] :void)
enter 3D drawing mode using a Camera3D handle.
Parameters
| camera | Camera3D handle from raylib/camera camera-3d |
Example
(begin-mode-3d cam)
Since: P3
defn
end-mode-3d
(end-mode-3d :void)
exit 3D drawing mode.
Example
(end-mode-3d)
Since: P3
defn
clear-background
(clear-background [col :int] :void)
fill the backbuffer with a solid color.
Parameters
| col | Color handle from raylib/color |
Example
(clear-background (raywhite))
Since: P3
defn
set-target-fps
(set-target-fps [fps :int] :void)
cap the frame rate.
Parameters
| fps | target frames per second (0 = uncapped) |
Example
(set-target-fps 60)
Since: P3
defn
get-frame-time
(get-frame-time :float)
return the duration of the last frame in seconds.
Returns
Frame time as :float (delta time for physics / animation).
Example
(let [dt (get-frame-time)] ...)
Since: P3