LWXGL supports multiple virtual screens within a single window. Each element belongs to one screen (default: screenDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DRessedAlarm184/LWXGL/llms.txt
Use this file to discover all available pages before exploring further.
0). Only elements whose screen index matches the active screen are rendered and receive input events. This lets you build multi-page UIs — settings panels, wizards, confirmation pages — without managing separate windows or manually hiding and showing dozens of elements.
Virtual Screens
GScreenActive returns a pointer to the active screen index integer. Dereference it to read the current screen, or assign through it to switch screens immediately:
GScreenApply assigns screen index s to each element in the ids array. Newly created elements always start on screen 0 — call GScreenApply after creation to move them.
Elements with screen index -1 are always visible, regardless of the active screen. Use this for persistent UI chrome such as a top navigation bar or a status footer.
Two-Screen UI Example
Switching the active screen by writing to
*GScreenActive() takes effect immediately — on the next GRenderWindow() call only the elements matching the new screen (and those on screen -1) will be drawn or receive input.Modal Dialogs
LWXGL provides a built-in blocking modal dialog that overlays the window content and blocks all element interactions while open.| Parameter | Description |
|---|---|
type | 0 = OK-only dialog (single “OK” button). 1 = Confirm/Cancel dialog (“Cancel” and “OK” buttons). |
msg | The message displayed inside the modal. Supports \n for line breaks. Lines are clipped at approximately 31 characters wide. |
on_confirm | Callback fired when the user clicks OK (type 0) or Confirm/OK (type 1). Pass NULL for no action on confirm. |
GQueryModalOpen returns 1 while the modal is displayed. During this time:
- All element click and keyboard callbacks are suppressed.
- Button
onclickhandlers do not fire. - Input elements do not accept typing.
on_confirm. There is no on_cancel callback.
The modal is rendered at a fixed position centered horizontally at the top of the window (approximately
y = 47 to y = 200). It uses the built-in palette — styling is not configurable.