LWXGL’s screen system lets you organize elements into numbered layers. Only elements whose screen number matches the currently active screen — plus any elements assigned to the special 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.
-1 — are rendered and receive input. Switching screens is instantaneous: no elements are created, deleted, or reset.
How screens work
- Every element starts on screen
0by default. GScreenApplyassigns a batch of elements to a screen number in one call.GScreenActivereturns a pointer to the active screen integer. Write a new value through the pointer to switch screens.- Elements with screen value
-1are always visible regardless of which screen is active.
Example: two-page application
Persistent elements (screen -1)
Elements that should always be visible — such as a status bar, a background panel, or a persistent menu — can be assigned to screen-1:
Renderer integration
The renderer checkse->screen == active_screen || e->screen == -1 before drawing or processing input for each element. There is no overhead for elements on inactive screens — they are simply skipped.
Screen switching does not affect element state. Checkbox values, input text, console content, and image pixel buffers are all preserved when the active screen changes. Switching back to a screen restores elements exactly as they were left.