View Source Rayex.Core (Rayex v0.0.3)

Main functions

Summary

Functions

Setup canvas (framebuffer) to start drawing

Begin 2D mode with custom camera (2D)

Begin 3D mode with custom camera (3D)

Set background color (framebuffer clear color)

Clear window configuration state flags

Close window and unload OpenGL context

Disables cursor (lock cursor)

Enables cursor (unlock cursor)

End canvas drawing and swap buffers (double buffering)

Ends 2D mode with custom camera

Ends 3D mode and returns to default 2D orthographic mode

See Rayex.Unifex.Raylib.get_char_pressed/0.

Get current FPS

Get time in seconds for last frame drawn (delta time)

See Rayex.Unifex.Raylib.get_key_pressed/0.

Get mouse position XY

Get a ray trace from mouse position

Get elapsed time in seconds since init_window/0

Hides cursor

Initialize window and OpenGL context

Check if cursor is not visible

Check if cursor is on the screen

Check if a key is being pressed

Check if a key has been pressed once

Check if a key is being pressed

Check if a key has been released

Check is a key is not being pressed

Check if a mouse button is being pressed

Check if a mouse button has been pressed once

Check if a mouse button has been released once

Check if a mouse button is NOT being pressed

Set the key that will close the program

Set target FPS (maximum)

Set window configuration state using flags

Shows cursor

Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)

Update camera position for selected mode

Check if window is currently focused (only PLATFORM_DESKTOP)

Check if window is currently fullscreen

Check if window is currently hidden (only PLATFORM_DESKTOP)

Check if window is currently maximized (only PLATFORM_DESKTOP)

Check if window is currently minimized (only PLATFORM_DESKTOP)

Check if window has been initialized successfully

Check if window has been resized last frame

Check if KEY_ESCAPE pressed or Close icon pressed

Check if one specific window flag is enabled

Functions

@spec begin_drawing() :: :ok

Setup canvas (framebuffer) to start drawing

Link to this function

begin_mode_2d(camera_2d)

View Source
@spec begin_mode_2d(Rayex.Structs.Camera2D.t()) :: :ok

Begin 2D mode with custom camera (2D)

Link to this function

begin_mode_3d(camera_3d)

View Source
@spec begin_mode_3d(Rayex.Structs.Camera3D.t()) :: :ok

Begin 3D mode with custom camera (3D)

@spec clear_background(Rayex.Structs.Color.t()) :: :ok

Set background color (framebuffer clear color)

Link to this function

clear_window_state(flag)

View Source
@spec clear_window_state(non_neg_integer()) :: :ok

Clear window configuration state flags

@spec close_window() :: :ok

Close window and unload OpenGL context

@spec disable_cursor() :: :ok

Disables cursor (lock cursor)

@spec enable_cursor() :: :ok

Enables cursor (unlock cursor)

@spec end_drawing() :: :ok

End canvas drawing and swap buffers (double buffering)

@spec end_mode_2d() :: :ok

Ends 2D mode with custom camera

@spec end_mode_3d() :: :ok

Ends 3D mode and returns to default 2D orthographic mode

@spec get_char_pressed() :: integer()

See Rayex.Unifex.Raylib.get_char_pressed/0.

@spec get_fps() :: non_neg_integer()

Get current FPS

@spec get_frame_time() :: float()

Get time in seconds for last frame drawn (delta time)

@spec get_key_pressed() :: integer()

See Rayex.Unifex.Raylib.get_key_pressed/0.

@spec get_mouse_position() :: Rayex.Structs.Vector2.t()

Get mouse position XY

Link to this function

get_mouse_ray(mouse_position, camera)

View Source

Get a ray trace from mouse position

@spec get_time() :: float()

Get elapsed time in seconds since init_window/0

@spec hide_cursor() :: :ok

Hides cursor

Link to this function

init_window(width, height, title)

View Source
@spec init_window(integer(), integer(), String.t()) :: :ok

Initialize window and OpenGL context

@spec is_cursor_hidden?() :: boolean()

Check if cursor is not visible

@spec is_cursor_on_screen?() :: boolean()

Check if cursor is on the screen

@spec is_key_down?(integer()) :: boolean()

Check if a key is being pressed

@spec is_key_pressed?(integer()) :: boolean()

Check if a key has been pressed once

Link to this function

is_key_pressed_repeat?(key)

View Source
@spec is_key_pressed_repeat?(integer()) :: boolean()

Check if a key is being pressed

@spec is_key_released?(integer()) :: boolean()

Check if a key has been released

@spec is_key_up?(integer()) :: boolean()

Check is a key is not being pressed

Link to this function

mouse_button_down?(button)

View Source
@spec mouse_button_down?(integer()) :: boolean()

Check if a mouse button is being pressed

Link to this function

mouse_button_pressed?(button)

View Source
@spec mouse_button_pressed?(integer()) :: boolean()

Check if a mouse button has been pressed once

Link to this function

mouse_button_released?(button)

View Source
@spec mouse_button_released?(integer()) :: boolean()

Check if a mouse button has been released once

Link to this function

mouse_button_up?(button)

View Source
@spec mouse_button_up?(integer()) :: boolean()

Check if a mouse button is NOT being pressed

@spec set_exit_key(integer()) :: :ok

Set the key that will close the program

@spec set_target_fps(non_neg_integer()) :: :ok

Set target FPS (maximum)

@spec set_window_state(non_neg_integer()) :: :ok

Set window configuration state using flags

@spec show_cursor() :: :ok

Shows cursor

@spec toggle_fullscreen() :: :ok

Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)

Link to this function

update_camera(camera_3d, mode)

View Source

Update camera position for selected mode

Link to this function

update_camera_pro(camera_3d, movement, rotation, zoom)

View Source

Update camera movement/rotation

@spec window_focused?() :: boolean()

Check if window is currently focused (only PLATFORM_DESKTOP)

@spec window_fullscreen?() :: boolean()

Check if window is currently fullscreen

@spec window_hidden?() :: boolean()

Check if window is currently hidden (only PLATFORM_DESKTOP)

@spec window_maximized?() :: boolean()

Check if window is currently maximized (only PLATFORM_DESKTOP)

@spec window_minimized?() :: boolean()

Check if window is currently minimized (only PLATFORM_DESKTOP)

@spec window_ready?() :: boolean()

Check if window has been initialized successfully

@spec window_resized?() :: boolean()

Check if window has been resized last frame

@spec window_should_close() :: boolean()

Check if KEY_ESCAPE pressed or Close icon pressed

@spec window_state?(non_neg_integer()) :: boolean()

Check if one specific window flag is enabled