LinuxCommandLibrary

glxdemo

Demonstrate and test OpenGL rendering capabilities

SYNOPSIS

glxdemo [-display host:display.screen] [-visual configID] [-info]

PARAMETERS

-display host:display.screen
    Specify the X display to connect to.

-visual configID
    Use the specified GLX visual configuration ID.

-info
    Print GLX support information and exit without running demo.

DESCRIPTION

The glxdemo command is a simple demonstration program for the GLX (OpenGL Extension to the X Window System) interface. It creates an X11 window and renders a basic OpenGL scene, typically a rotating colored triangle or cube, using direct rendering if supported by the graphics driver. This tool is primarily used to verify that hardware-accelerated OpenGL rendering via GLX is functioning correctly on Linux systems.

Upon execution, glxdemo opens a window displaying smooth 3D animation, showcasing features like double buffering, depth testing, and texture mapping. If direct rendering is unavailable (e.g., due to software rendering or driver issues), the demo may run slowly or fail. It serves as a quick diagnostic for Mesa, NVIDIA, or AMD graphics stacks, helping users confirm GLX extension support and visual configuration compatibility.

Common use cases include post-installation testing of OpenGL drivers, debugging Mesa libGL issues, or validating X11 forwarding over SSH with X11 forwarding enabled. The demo exits cleanly upon window close (typically Ctrl+C or window manager close) and provides verbose output with the -info option for GLX capabilities.

CAVEATS

Requires X11 (not Wayland); fails without GLX support or direct rendering. May require glx-utils package. Slow on software renderers.

EXIT STATUS

0 on success; non-zero on errors like no GLX visuals or connection failure.

DEPENDENCIES

libGL, libX11, libXext; installed via mesa-utils or glx-utils on Debian/Ubuntu.

HISTORY

Introduced in early Mesa3D releases (circa 1990s-2000s) as part of XFree86/Mesa GLX demos. Maintained in modern Mesa glx-utils for legacy X11 OpenGL testing.

SEE ALSO

Copied to clipboard