Skip to content

Window functions

Finalspace edited this page May 29, 2026 · 1 revision

This category contains functions for handling the window. More...

Enumerations

Type Name
enum fplWindowState {
fplWindowState_Unknown , fplWindowState_Normal , fplWindowState_Iconify , fplWindowState_Maximize ,
fplWindowState_Fullscreen
}
An enumeration containing the states of a window. More...
enum fplWindowVisibilityState { fplWindowVisibilityState_Unknown , fplWindowVisibilityState_Show , fplWindowVisibilityState_Hide }
An enumeration containing the visibility state of a window. More...

Functions

Type Name
fpl_platform_api bool fplDisableWindowFullscreen (void)
Switches the window back to window mode.
fpl_platform_api bool fplEnableWindowFullscreen (void)
Enables fullscreen mode on the nearest display.
fpl_platform_api bool fplGetWindowPosition (fplWindowPosition *outPos)
Retrieves the absolute window position.
fpl_platform_api bool fplGetWindowSize (fplWindowSize *outSize)
Retrieves the inner window size.
fpl_platform_api fplWindowState fplGetWindowState (void)
Gets the current window state.
fpl_common_api size_t fplGetWindowTitle (char *outTitle, const size_t maxOutTitleLength)
Retrieves the window title and writes it into the output string.
fpl_platform_api bool fplIsWindowDecorated (void)
Gets the window decorated state as boolean.
fpl_platform_api bool fplIsWindowFloating (void)
Gets the window floating state as boolean.
fpl_platform_api bool fplIsWindowFullscreen (void)
Gets the window fullscreen state as boolean.
fpl_platform_api bool fplIsWindowResizable (void)
Gets the window resizable state as boolean.
fpl_platform_api bool fplIsWindowRunning (void)
Gets the window running state as a boolean.
fpl_platform_api bool fplQueryCursorPosition (int32_t *outX, int32_t *outY)
Queries the cursor position in screen coordinates, relative to the root screen.
fpl_platform_api void fplSetWindowCursorEnabled (const bool value)
Enables or disables the window cursor.
fpl_platform_api void fplSetWindowDecorated (const bool value)
Enables or disables the window decoration (Titlebar, Border, etc.).
fpl_platform_api void fplSetWindowFloating (const bool value)
Enables or disables the window floating (Top-most).
fpl_platform_api bool fplSetWindowFullscreenRect (const bool value, const int32_t x, const int32_t y, const int32_t width, const int32_t height)
Enables or disables fullscreen mode based on the given rectangle.
fpl_platform_api bool fplSetWindowFullscreenSize (const bool value, const uint32_t fullscreenWidth, const uint32_t fullscreenHeight, const uint32_t refreshRate)
Enables or disables fullscreen mode based on the given size and the current display.
fpl_common_api void fplSetWindowInputEvents (const bool enabled)
Enables or disables the input events for the window entirely.
fpl_platform_api void fplSetWindowPosition (const int32_t left, const int32_t top)
Changes the window absolute position to the given coordinates.
fpl_platform_api void fplSetWindowResizeable (const bool value)
Enables or disables the ability to resize the window.
fpl_platform_api void fplSetWindowSize (const uint32_t width, const uint32_t height)
Resizes the window to fit the inner size based on the given size.
fpl_platform_api bool fplSetWindowState (const fplWindowState newState)
Changes the current window state.
fpl_platform_api void fplSetWindowTitle (const char *title)
Changes the window title to the given string.
fpl_platform_api void fplWindowShutdown (void)
Closes the window and stops the event loop.
fpl_platform_api bool fplWindowUpdate (void)
Clears the internal event queue and updates input devices if needed.

Detailed Description

This category contains functions for handling the window.

Enumeration Type Documentation

fplWindowState

enum fplWindowState

An enumeration containing the states of a window.

Name Description
fplWindowState_Unknown Unknown state.
fplWindowState_Normal Normal window state.
fplWindowState_Iconify Iconify/Minimize window state.
fplWindowState_Maximize Maximize window state.
fplWindowState_Fullscreen Fullscreen state.

Definition at line 9883 of file final_platform_layer.h.

fplWindowVisibilityState

enum fplWindowVisibilityState

An enumeration containing the visibility state of a window.

Name Description
fplWindowVisibilityState_Unknown Unknown state.
fplWindowVisibilityState_Show Window is visible.
fplWindowVisibilityState_Hide Window is hidden.

Definition at line 9900 of file final_platform_layer.h.

Function Documentation

fplDisableWindowFullscreen()

fpl_platform_api bool fplDisableWindowFullscreen ( void )

Switches the window back to window mode.

Returns: Returns true when the window was changed to window mode, false otherwise.

Attention: This will not alter the display resolution or the refresh rate.

fplEnableWindowFullscreen()

fpl_platform_api bool fplEnableWindowFullscreen ( void )

Enables fullscreen mode on the nearest display.

Returns: Returns true when the window was changed to fullscreen, false otherwise.

Attention: This will not alter the display resolution or the refresh rate.

fplGetWindowPosition()

fpl_platform_api bool fplGetWindowPosition ( fplWindowPosition * outPos)

Retrieves the absolute window position.

Parameters

Direction Parameter Description
[out] outPos Reference to the window position structure fplWindowPosition.

Returns: Returns true when we got the position, false otherwise.

fplGetWindowSize()

fpl_platform_api bool fplGetWindowSize ( fplWindowSize * outSize)

Retrieves the inner window size.

Parameters

Direction Parameter Description
[out] outSize Reference to the window size structure.

Returns: Returns true when we got the inner size from the current window, false otherwise.

fplGetWindowState()

fpl_platform_api fplWindowState fplGetWindowState ( void )

Gets the current window state.

Returns: Returns the current window state.

fplGetWindowTitle()

fpl_common_api size_t fplGetWindowTitle ( char * outTitle, const size_t maxOutTitleLength )

Retrieves the window title and writes it into the output string.

Parameters

Direction Parameter Description
[out] outTitle The output title string (may be null to query the required size only).
[in] maxOutTitleLength The maximum length of the output title.

Returns: Returns the total number of characters required (excluding NUL). Returns 0 on hard error or when the buffer is too small.

fplIsWindowDecorated()

fpl_platform_api bool fplIsWindowDecorated ( void )

Gets the window decorated state as boolean.

Returns: Returns true when the window is decorated, false otherwise.

fplIsWindowFloating()

fpl_platform_api bool fplIsWindowFloating ( void )

Gets the window floating state as boolean.

Returns: Returns true when the window is floating, false otherwise.

fplIsWindowFullscreen()

fpl_platform_api bool fplIsWindowFullscreen ( void )

Gets the window fullscreen state as boolean.

Returns: Returns true when the window is in fullscreen mode, false otherwise.

fplIsWindowResizable()

fpl_platform_api bool fplIsWindowResizable ( void )

Gets the window resizable state as boolean.

Returns: Returns true when the window is resizable, false otherwise.

fplIsWindowRunning()

fpl_platform_api bool fplIsWindowRunning ( void )

Gets the window running state as a boolean.

Returns: Returns true when the window is running, false otherwise.

fplQueryCursorPosition()

fpl_platform_api bool fplQueryCursorPosition ( int32_t * outX, int32_t * outY )

Queries the cursor position in screen coordinates, relative to the root screen.

Parameters

Direction Parameter Description
[out] outX Reference to the outgoing X position.
[out] outY Reference to the outgoing Y position.

fplSetWindowCursorEnabled()

fpl_platform_api void fplSetWindowCursorEnabled ( const bool value)

Enables or disables the window cursor.

Parameters

Direction Parameter Description
[in] value The new cursor visibility state.

fplSetWindowDecorated()

fpl_platform_api void fplSetWindowDecorated ( const bool value)

Enables or disables the window decoration (Titlebar, Border, etc.).

Parameters

Direction Parameter Description
[in] value The new decorated state.

fplSetWindowFloating()

fpl_platform_api void fplSetWindowFloating ( const bool value)

Enables or disables the window floating (Top-most).

Parameters

Direction Parameter Description
[in] value The new floating state.

fplSetWindowFullscreenRect()

fpl_platform_api bool fplSetWindowFullscreenRect ( const bool value, const int32_t x, const int32_t y, const int32_t width, const int32_t height )

Enables or disables fullscreen mode based on the given rectangle.

Parameters

Direction Parameter Description
[in] value The new fullscreen state.
[in] x The left position in virtual screen coordinates.
[in] y The top position in virtual screen coordinates.
[in] width The width in virtual screen coordinates.
[in] height The height in virtual screen coordinates.

Returns: Returns true when the window was changed to the rectangle, false otherwise.

Attention: This will not alter the display resolution or the refresh rate.

fplSetWindowFullscreenSize()

fpl_platform_api bool fplSetWindowFullscreenSize ( const bool value, const uint32_t fullscreenWidth, const uint32_t fullscreenHeight, const uint32_t refreshRate )

Enables or disables fullscreen mode based on the given size and the current display.

Parameters

Direction Parameter Description
[in] value The new fullscreen state.
[in] fullscreenWidth The fullscreen width in screen units. When set to zero the current display position is used.
[in] fullscreenHeight The fullscreen height in screen units. When set to zero the current display position is used.
[in] refreshRate The refresh rate in Hz. When set to zero the current display setting is used.

Returns: Returns true when the window was changed to the desired fullscreen mode, false otherwise.

Attention: This may alter the display resolution or the refresh rate.

fplSetWindowInputEvents()

fpl_common_api void fplSetWindowInputEvents ( const bool enabled)

Enables or disables the input events for the window entirely.

Parameters

Direction Parameter Description
[in] enabled If set to true, the input events are processed; if false, no input events are handled.

Note: The text input event is always handled, regardless of this setting.

fplSetWindowPosition()

fpl_platform_api void fplSetWindowPosition ( const int32_t left, const int32_t top )

Changes the window absolute position to the given coordinates.

Parameters

Direction Parameter Description
[in] left The left position in screen units.
[in] top The top position in screen units.

fplSetWindowResizeable()

fpl_platform_api void fplSetWindowResizeable ( const bool value)

Enables or disables the ability to resize the window.

Parameters

Direction Parameter Description
[in] value The new resizable state.

fplSetWindowSize()

fpl_platform_api void fplSetWindowSize ( const uint32_t width, const uint32_t height )

Resizes the window to fit the inner size based on the given size.

Parameters

Direction Parameter Description
[in] width The width in screen units.
[in] height The height in screen units.

fplSetWindowState()

fpl_platform_api bool fplSetWindowState ( const fplWindowState newState)

Changes the current window state.

Parameters

Direction Parameter Description
[in] newState The new window state.

Returns: Returns true when the window state was changed, false otherwise.

fplSetWindowTitle()

fpl_platform_api void fplSetWindowTitle ( const char * title)

Changes the window title to the given string.

Parameters

Direction Parameter Description
[in] title The title string.

fplWindowUpdate()

fpl_platform_api bool fplWindowUpdate ( void )

Clears the internal event queue and updates input devices if needed.

Returns: Returns true when the window is still active, false otherwise.

Final Platform Layer

Pages

Topics

Data Structures

Clone this wiki locally