LWXGL (Lightweight X11 Graphics Library) is a C shared library that lets you build native Linux desktop GUI applications directly on top of X11 without the overhead of a full toolkit. It exposes a flat C API: create a window, place widgets by ID, attach event callbacks, and run a frame-loop — all in under a hundred lines of code.Documentation 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.
Installation
Build and install the shared library from source in two commands
Quickstart
Write your first LWXGL window with a button and event loop
Core Concepts
Understand the window lifecycle, element system, and color palette
API Reference
Full reference for every function in libLWXGL.h
What’s inside
LWXGL bundles everything you need to build a functional desktop UI:UI Widgets
Buttons, text labels, input fields, checkboxes, consoles, rectangles, and ellipses — all managed by integer IDs
Raster Graphics
Per-pixel image canvases with primitives: lines, circles, triangles, rectangles, and RLE sprites
Image Loading
Load indexed-color TGA and XBM files from disk or memory, capture screen regions
Events & Input
Keyboard, mouse, resize, scroll, and window-close callbacks with per-frame polling
16-Color Palette
Named palette constants with runtime modification — recolor your entire UI in one call
Modals & Scroll
Built-in alert, confirm, and input modals; scrollable window canvas with a scrollbar
Key design principles
- Flat C API — every function is a top-level C function; no objects, no vtables, no headers beyond
libLWXGL.h - ID-based elements — widgets are created and updated via a caller-chosen integer ID, making element management predictable
- Indexed color — all drawing uses a 16-entry palette of named colors (
CLR_BLACKthroughCLR_WHITE), which can be swapped at runtime - Frame-rate loop —
MainWindowLoopdrives rendering at a fixed target FPS; your callback receives the tick count and delta time
LWXGL requires a running X11 display server. It is designed for Linux systems with Xlib installed (
libx11-dev or equivalent).