Skip to main content

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.

LWXGL (Lightweight X11 Graphics Library) is a minimal C/C++ shared library that makes it straightforward to open an X11 window and populate it with interactive GUI elements — buttons, text labels, input fields, checkboxes, rectangles, and pixel-addressable image canvases — all through a flat C API backed by a single header file.

Quickstart

Open a window and render your first element in under five minutes.

Building & Installing

Compile the shared library and install it system-wide with Make.

UI Elements Guide

Create and manage buttons, inputs, text labels, and checkboxes.

API Reference

Full reference for every function exported by LWXGL.

What LWXGL provides

LWXGL is designed to be small and direct. The entire public surface lives in libLWXGL.h, and the library compiles to a single .so file linked against libX11.

Window & Loop

Fixed-size window creation with a built-in FPS-capped render loop.

16-Color Palette

All colors are palette indices 0–15. The palette is modifiable at runtime.

Element System

Every widget is an integer-ID element that LWXGL renders automatically.

Event Handling

Callback and polling APIs for keyboard, mouse, and window-close events.

Image Canvases

Palette-indexed pixel buffers with rect, circle, line, and sprite primitives.

Modals

Blocking OK and OK/Cancel dialog overlays with confirm callbacks.

How it works

1

Build and install the library

Clone the repository and run make build && make install to produce libLWXGL.so and copy it to /usr/local/lib.
2

Include the header

Add #include <libLWXGL.h> to your C or C++ source and link with -lLWXGL -lX11.
3

Create a window and elements

Call GCreateWindow to open an X11 window, then create elements by ID using functions like GCreateButton or GCreateText.
4

Run the loop

Call GSimpleWindowLoop with a target FPS and a per-frame callback — LWXGL handles event processing and rendering automatically on every frame.

Build docs developers (and LLMs) love