Cygwin/X User's Guide
Prev | Chapter 3. Using Cygwin/X | Next

# OpenGL (GLX)

The Cygwin/X X Server supports both software OpenGL rendering (using the mesa software renderer), and hardware accelerated OpenGL rendering (using the native Windows OpenGL (WGL) interface).

The X server command line options `-wgl` and `-nowgl` turn on and off the use of the native Windows OpenGL implementation. Currently `-wgl` is only supported in multiwindow mode, and is on by default in that mode. `-wgl` has no effect if your display driver does not support hardware-accelerated OpenGL.

(Since xserver 1.17, the creation of indirect GLX contexts is disabled by default. The `+iglx` option is required to allow them. Since Mesa 24.2, the DRI module loaded by the xserver is replaced by a stub which only supports direct contexts.)

Table 3-1. Summary of OpenGL rendering options

| hardware-accelerated rendering | software rendering a
--- | --- | ---
direct | start server with `-wgl` option (default) (local clients only) | export LIBGL_ALWAYS_SOFTWARE=1
indirect (Uses GLX protocol, limited to OpenGL 1.4) (No longer supported) | start server with `+iglx -wgl` options export LIBGL_ALWAYS_INDIRECT=1 | start server with `+iglx -nowgl` options export LIBGL_ALWAYS_INDIRECT=1
Notes: a. The software renderer used (e.g. llvmpipe, softpipe) can be selected using the GALLIUM_DRIVER environment variable.

Currently the default configurations are:

- For local clients the default is direct, hardware-accelerated rendering.

  To use software rendering, you must do export LIBGL_ALWAYS_SOFTWARE=1 before starting the client application.

- For remote clients, Mesa's libGL prefers to use client-side software rendering and then transfer the rendered image to the server.

If glxinfo | grep OpenGL outputs something mentioning your graphics card vendor, you have hardware-accelerated rendering. If it mentions Mesa, you have software rendering.

Please ensure you are using the latest display drivers for your graphics hardware before reporting any visual issues with WGL.

> Note: Please report problems with specific OpenGL applications to the cygwin mailing list.

Known issues:

- OpenGL drawing is just drawn on top of the X window. This works well enough when the OpenGL window is a top-level window, or is non-top-level and has no occluding relatives and is drawn after anything it occludes, but can mis-render in more complex scenarios.

- OpenGL windows with static contents aren't re-drawn when occluded by a native Window and then exposed. Workaround: force the window to redraw, e.g. by resizing it.

- When an OpenGL window is behind a native application window which uses layered windows for translucency, the OpenGL rendering is drawn over the top, flickering.

- Rendering to GLX pixmaps is only partially implemented due to WGL limitations.

Prev | Home | Next
Remote sessions via XDMCP | Up | Input internationalization