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 single shared library (libLWXGL.so) that makes it easy to build native Linux GUI applications directly on top of X11. It provides a retained-mode element system for buttons, text labels, inputs, consoles, and images alongside an immediate-mode drawing API — all backed by a fixed 16-color palette and a double-buffered render loop. For applications that need hardware acceleration, LWXGL can host a GLX-backed OpenGL surface element directly inside the window.

Installation

Build and install libLWXGL.so on your Linux system in two commands.

Quickstart

Create your first window, add a button, and run the event loop in under 30 lines of C.

Core Concepts

Understand windows, elements, the color palette, and the event model before diving deeper.

API Reference

Complete reference for every public function exported by libLWXGL.h.

What LWXGL provides

Retained Elements

Text, buttons, inputs, checkboxes, consoles, images, rectangles, and ellipses — each addressed by a developer-assigned integer ID.

Immediate Drawing

Draw text, rectangles, ellipses, and lines directly into the back-buffer on every frame without managing element IDs.

Image Canvas & Primitives

Pixel-level image elements with built-in rect, circle, line, triangle, and sprite (RLE) drawing primitives.

TGA & XBM Images

Load 8-bit indexed TGA files (raw and RLE) and monochrome XBM bitmaps with optional palette remapping.

OpenGL Surfaces

Embed a GLX-backed OpenGL pixmap element inside any LWXGL window for hardware-accelerated rendering.

Event Callbacks

Register callbacks for keyboard, mouse, window close, resize, and scroll events.

Getting started in three steps

1

Build and install

Clone the repository and run make && sudo make install to build libLWXGL.so and copy it and the header to the system paths.
2

Include the header and link

Add #include <libLWXGL.h> to your source file and compile with -lLWXGL -lX11 -lGL.
3

Create a window and run the loop

Call CreateWindow, add your elements, then enter MainWindowLoop — LWXGL handles rendering and events on every frame tick.

Build docs developers (and LLMs) love