View Source Exray.Core.Window (Exray v0.6.0)

Open, manage and handle the window that contains the cool stuff you create.

Summary

Functions

Clear window configuration state flags

Close window and unload OpenGL context

Disable waiting for events on EndDrawing(), automatic events polling

Enable waiting for events on EndDrawing(), no automatic event polling

Get clipboard text content

Get current connected monitor

Get number of connected monitors

Get specified monitor height (current video mode used by monitor)

Get the human-readable, UTF-8 encoded name of the specified monitor

Get specified monitor physical height in millimetres

Get specified monitor physical width in millimetres

Get specified monitor position

Get specified monitor refresh rate

Get specified monitor width (current video mode used by monitor)

Get current render height (it considers HiDPI)

Get current render width (it considers HiDPI)

Get current screen height

Get current screen width

Get native window handle

Get window position XY on monitor

Get window scale DPI factor

Initialize window and OpenGL context

Set window state: maximized, if resizable (only PLATFORM_DESKTOP)

Set window state: minimized, if resizable (only PLATFORM_DESKTOP)

Set window state: not minimized/maximized (only PLATFORM_DESKTOP)

Set clipboard text content

Set window focused (only PLATFORM_DESKTOP)

Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)

Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)

Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)

Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

Set monitor for the current window

Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)

Set window position on screen (only PLATFORM_DESKTOP)

Set window dimensions

Set window configuration state using flags (only PLATFORM_DESKTOP)

Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)

Toggle window state: borderless windowed (only PLATFORM_DESKTOP)

Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)

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 one specific window flag is enabled

Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)

Functions

Link to this function

clear_window_state(flags)

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

Clear window configuration state flags

@spec close_window() :: :ok

Close window and unload OpenGL context

@spec disable_event_waiting() :: :ok

Disable waiting for events on EndDrawing(), automatic events polling

@spec enable_event_waiting() :: :ok

Enable waiting for events on EndDrawing(), no automatic event polling

@spec get_clipboard_text() :: clipboard_text :: binary()

Get clipboard text content

@spec get_current_monitor() :: current_monitor :: integer()

Get current connected monitor

@spec get_monitor_count() :: monitor_count :: integer()

Get number of connected monitors

Link to this function

get_monitor_height(monitor)

View Source
@spec get_monitor_height(monitor :: integer()) :: monitor_height :: integer()

Get specified monitor height (current video mode used by monitor)

Link to this function

get_monitor_name(monitor)

View Source
@spec get_monitor_name(monitor :: integer()) :: monitor_name :: binary()

Get the human-readable, UTF-8 encoded name of the specified monitor

Link to this function

get_monitor_physical_height(monitor)

View Source
@spec get_monitor_physical_height(monitor :: integer()) ::
  monitor_physical_height :: integer()

Get specified monitor physical height in millimetres

Link to this function

get_monitor_physical_width(monitor)

View Source
@spec get_monitor_physical_width(monitor :: integer()) ::
  monitor_physical_width :: integer()

Get specified monitor physical width in millimetres

Link to this function

get_monitor_position(monitor)

View Source
@spec get_monitor_position(monitor :: integer()) ::
  monitor_position :: Exray.Structs.Vector2.t()

Get specified monitor position

Link to this function

get_monitor_refresh_rate(monitor)

View Source
@spec get_monitor_refresh_rate(monitor :: integer()) ::
  monitor_refresh_rate :: integer()

Get specified monitor refresh rate

Link to this function

get_monitor_width(monitor)

View Source
@spec get_monitor_width(monitor :: integer()) :: monitor_width :: integer()

Get specified monitor width (current video mode used by monitor)

@spec get_render_height() :: render_height :: integer()

Get current render height (it considers HiDPI)

@spec get_render_width() :: render_width :: integer()

Get current render width (it considers HiDPI)

@spec get_screen_height() :: screen_height :: integer()

Get current screen height

@spec get_screen_width() :: screen_width :: integer()

Get current screen width

@spec get_window_handle() :: window_handle :: term()

Get native window handle

@spec get_window_position() :: window_position :: Exray.Structs.Vector2.t()

Get window position XY on monitor

@spec get_window_scale_dpi() :: window_scale_dpi :: Exray.Structs.Vector2.t()

Get window scale DPI factor

Link to this function

init_window(width, height, title)

View Source
@spec init_window(width :: integer(), height :: integer(), title :: binary()) :: :ok

Initialize window and OpenGL context

@spec maximize_window() :: :ok

Set window state: maximized, if resizable (only PLATFORM_DESKTOP)

@spec minimize_window() :: :ok

Set window state: minimized, if resizable (only PLATFORM_DESKTOP)

@spec restore_window() :: :ok

Set window state: not minimized/maximized (only PLATFORM_DESKTOP)

Link to this function

set_clipboard_text(text)

View Source
@spec set_clipboard_text(text :: binary()) :: :ok

Set clipboard text content

@spec set_window_focused() :: :ok

Set window focused (only PLATFORM_DESKTOP)

@spec set_window_icon(image :: Exray.Structs.Image.t()) :: :ok

Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)

Link to this function

set_window_icons(images)

View Source
@spec set_window_icons(images :: [Exray.Structs.Image.t()]) :: :ok

Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)

Link to this function

set_window_max_size(width, height)

View Source
@spec set_window_max_size(width :: integer(), height :: integer()) :: :ok

Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)

Link to this function

set_window_min_size(width, height)

View Source
@spec set_window_min_size(width :: integer(), height :: integer()) :: :ok

Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)

Link to this function

set_window_monitor(monitor)

View Source
@spec set_window_monitor(monitor :: integer()) :: :ok

Set monitor for the current window

Link to this function

set_window_opacity(opacity)

View Source
@spec set_window_opacity(opacity :: float()) :: :ok

Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)

Link to this function

set_window_position(x, y)

View Source
@spec set_window_position(x :: integer(), y :: integer()) :: :ok

Set window position on screen (only PLATFORM_DESKTOP)

Link to this function

set_window_size(width, height)

View Source
@spec set_window_size(width :: integer(), height :: integer()) :: :ok

Set window dimensions

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

Set window configuration state using flags (only PLATFORM_DESKTOP)

@spec set_window_title(title :: binary()) :: :ok

Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)

Link to this function

toggle_borderless_windowed()

View Source
@spec toggle_borderless_windowed() :: :ok

Toggle window state: borderless windowed (only PLATFORM_DESKTOP)

@spec toggle_fullscreen() :: :ok

Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)

@spec window_is_focused?() :: window_is_focused :: boolean()

Check if window is currently focused (only PLATFORM_DESKTOP)

@spec window_is_fullscreen?() :: window_is_fullscreen :: boolean()

Check if window is currently fullscreen

@spec window_is_hidden?() :: window_is_hidden :: boolean()

Check if window is currently hidden (only PLATFORM_DESKTOP)

@spec window_is_maximized?() :: window_is_maximized :: boolean()

Check if window is currently maximized (only PLATFORM_DESKTOP)

@spec window_is_minimized?() :: window_is_minimized :: boolean()

Check if window is currently minimized (only PLATFORM_DESKTOP)

@spec window_is_ready?() :: window_is_ready :: boolean()

Check if window has been initialized successfully

@spec window_is_resized?() :: window_is_resized :: boolean()

Check if window has been resized last frame

@spec window_is_state?(flag :: non_neg_integer()) :: window_is_state :: boolean()

Check if one specific window flag is enabled

@spec window_should_close?() :: window_should_close :: boolean()

Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)