natiny_window_get_state

C
int natiny_window_get_state(NatinyWindow id);

Returns the current window state observed by the platform.

Parameters

Name Type Description
id NatinyWindow Window handle from natiny_window_create

Returns

Type Description
int One of the constants below; NATINY_WINDOW_STATE_NORMAL for an invalid handle

Constants

Constant State
NATINY_WINDOW_STATE_NORMAL Normal window
NATINY_WINDOW_STATE_MINIMIZED Minimized window
NATINY_WINDOW_STATE_MAXIMIZED Maximized window
NATINY_WINDOW_STATE_FULLSCREEN Fullscreen window

Example

C
if (natiny_window_get_state(win) != NATINY_WINDOW_STATE_MINIMIZED)
    draw_the_world();

Notes

  • In a browser, the function returns only NATINY_WINDOW_STATE_NORMAL or NATINY_WINDOW_STATE_FULLSCREEN.
  • On Android, the function returns the last supported state requested through natiny_window_set_state: NATINY_WINDOW_STATE_NORMAL or NATINY_WINDOW_STATE_FULLSCREEN.