Final Platform Layer  0.9.6-beta
Typedefs | Enumerations | Functions
Window functions

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

Typedefs

typedef enum fplWindowState fplWindowState
 An enumeration containg the states of a window.
 
typedef enum fplWindowVisibilityState fplWindowVisibilityState
 An enumeration containing the visibility state of a window.
 

Enumerations

enum  fplWindowState {
  fplWindowState_Unknown, fplWindowState_Normal, fplWindowState_Iconify, fplWindowState_Maximize,
  fplWindowState_Fullscreen
}
 An enumeration containg 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

fpl_platform_api bool fplDisableWindowFullscreen ()
 Switches the window back to window mode. More...
 
fpl_platform_api bool fplEnableWindowFullscreen ()
 Enables fullscreen mode on the nearest display. More...
 
fpl_platform_api bool fplGetWindowPosition (fplWindowPosition *outPos)
 Retrieves the absolute window position. More...
 
fpl_platform_api bool fplGetWindowSize (fplWindowSize *outSize)
 Retrieves the inner window size. More...
 
fpl_platform_api fplWindowState fplGetWindowState ()
 Gets the current window state. More...
 
fpl_common_api char * fplGetWindowTitle (char *outTitle, const size_t maxOutTitleLength)
 Retrieves the window title and writes it into the output string. More...
 
fpl_platform_api bool fplIsWindowDecorated ()
 Gets the window decorated state as boolean. More...
 
fpl_platform_api bool fplIsWindowFloating ()
 Gets the window floating state as boolean. More...
 
fpl_platform_api bool fplIsWindowFullscreen ()
 Gets the window fullscreen state as boolean. More...
 
fpl_platform_api bool fplIsWindowResizable ()
 Gets the window resizable state as boolean. More...
 
fpl_platform_api bool fplIsWindowRunning ()
 Gets the window running state as a boolean. More...
 
fpl_platform_api void fplSetWindowCursorEnabled (const bool value)
 Enables or disables the window cursor. More...
 
fpl_platform_api void fplSetWindowDecorated (const bool value)
 Enables or disables the window decoration (Titlebar, Border, etc.). More...
 
fpl_platform_api void fplSetWindowFloating (const bool value)
 Enables or disables the window floating (Top-most) More...
 
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. More...
 
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. More...
 
fpl_common_api void fplSetWindowInputEvents (const bool enabled)
 Enables or Disables the input events for the window entirely. More...
 
fpl_platform_api void fplSetWindowPosition (const int32_t left, const int32_t top)
 Changes the window absolute position to the given coordinates. More...
 
fpl_platform_api void fplSetWindowResizeable (const bool value)
 Enables or disables the ability to resize the window. More...
 
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. More...
 
fpl_platform_api bool fplSetWindowState (const fplWindowState newState)
 Changes the current window state. More...
 
fpl_platform_api void fplSetWindowTitle (const char *title)
 Changes the window title to the given string. More...
 
fpl_platform_api void fplWindowShutdown ()
 Closes the window and stops the event loop.
 
fpl_platform_api bool fplWindowUpdate ()
 Clears the internal event queue and updates input devices if needed. More...
 

Detailed Description

This category contains functions for handling the window.

Enumeration Type Documentation

◆ fplWindowState

An enumeration containg the states of a window.

Enumerator
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 6163 of file final_platform_layer.h.

◆ fplWindowVisibilityState

An enumeration containing the visibility state of a window.

Enumerator
fplWindowVisibilityState_Unknown 

Unknown state.

fplWindowVisibilityState_Show 

Window is visible.

fplWindowVisibilityState_Hide 

Window is hidden.

Definition at line 6177 of file final_platform_layer.h.

Function Documentation

◆ fplDisableWindowFullscreen()

fpl_platform_api bool fplDisableWindowFullscreen ( )

Switches the window back to window mode.

Returns
Returns true when the window was changed to the window mode, false otherwise.
Attention
This will not alter the display resolution or the refresh rate.

◆ fplEnableWindowFullscreen()

fpl_platform_api bool fplEnableWindowFullscreen ( )

Enables fullscreen mode on the nearest display.

Returns
Returns true when the window was changed to the 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
outPosThe pointer to the fplWindowPosition structure
Returns
Returns true when we got the position, false otherwise.

◆ fplGetWindowSize()

fpl_platform_api bool fplGetWindowSize ( fplWindowSize outSize)

Retrieves the inner window size.

Parameters
outSizeThe pointer to the fplWindowSize structure
Returns
Returns true when we got the inner size from the current window, false otherwise.

◆ fplGetWindowState()

fpl_platform_api fplWindowState fplGetWindowState ( )

Gets the current window state.

Returns
Returns the current window state

◆ fplGetWindowTitle()

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

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

Parameters
outTitleThe output title string
maxOutTitleLengthThe maximum length of the output title
Returns
Returns the char pointer of the last written character or fpl_null

◆ fplIsWindowDecorated()

fpl_platform_api bool fplIsWindowDecorated ( )

Gets the window decorated state as boolean.

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

◆ fplIsWindowFloating()

fpl_platform_api bool fplIsWindowFloating ( )

Gets the window floating state as boolean.

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

◆ fplIsWindowFullscreen()

fpl_platform_api bool fplIsWindowFullscreen ( )

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 ( )

Gets the window resizable state as boolean.

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

◆ fplIsWindowRunning()

fpl_platform_api bool fplIsWindowRunning ( )

Gets the window running state as a boolean.

Returns
Returns true when the window is running, false otherwise

◆ fplSetWindowCursorEnabled()

fpl_platform_api void fplSetWindowCursorEnabled ( const bool  value)

Enables or disables the window cursor.

Parameters
valueThe new cursor visibility state

◆ fplSetWindowDecorated()

fpl_platform_api void fplSetWindowDecorated ( const bool  value)

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

Parameters
valueThe new decorated state

◆ fplSetWindowFloating()

fpl_platform_api void fplSetWindowFloating ( const bool  value)

Enables or disables the window floating (Top-most)

Parameters
valueThe 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
valueThe new fullscreen state
xThe left position in virtual screen coordinates
yThe top position in virtual screen coordinates
widthThe width in virtual screen coordinates
heightThe 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
valueThe new fullscreen state
fullscreenWidthThe fullscreen width in screen units. When set to zero the current display position is used.
fullscreenHeightThe fullscreen height in screen units. When set to zero the current display position is used.
refreshRateThe refresh rate in Hz. When set to zero the current display setting is used.
Returns
Returns true when the window was changed to the desire 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
enabledIf set to true, the input handled 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
leftThe left position in screen units
topThe top position in screen units

◆ fplSetWindowResizeable()

fpl_platform_api void fplSetWindowResizeable ( const bool  value)

Enables or disables the ability to resize the window.

Parameters
valueThe 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
widthThe width in screen units
heightThe height in screen units

◆ fplSetWindowState()

fpl_platform_api bool fplSetWindowState ( const fplWindowState  newState)

Changes the current window state.

Parameters
newStateThe 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
titleThe title string

◆ fplWindowUpdate()

fpl_platform_api bool fplWindowUpdate ( )

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

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