Raspberry Pi OpenGL 2.1 Support Tested with GeeXLab

The latest GeeXLab is available with a new support: Raspberry Pi with OpenGL desktop (OpenGL 2.1).

So far, the Raspberry Pi platform was supported by GeeXLab with OpenGL ES 2.0 only. The OpenGL ES support has a limitation: the lack of GPU accelerated window support. It’s not possible to create an OpenGL context attached to a window like we can do on Windows (WGL), OS X (NSOpenGL) or Linux (GLX). The OpenGL ES context is attached to the desktop: it’s perfect for a fullscreen app, not really handy for a windowed app. But now, things are different: we can now create OpenGL contexts with GLX (X11) functions on the Raspberry Pi since the release of the new Raspbian Jessie Feb 2016.

The Raspberry Pi is a great platform and the support of GLX on the Raspberry Pi is a nice addition because we have now X11 windows with OpenGL 2.1 contexts. With minor or no modification, you can recompile an X11 + OpenGL application on the Raspberry Pi. In the latest version of Raspbian Jessie, the hardware accelerated OpenGL support is experimental and can be enabled or disabled. By defaut it’s disabled but you still have OpenGL 2.1 via a software renderer.

Before I forget, the OpenGL 2.1 support is limited to Raspberry Pi 2 boards.

Raspberry Pi 2 board

To test the OpenGL 2.1 support of the Raspberry Pi, I created a small OpenGL demo with GeeXLab that displays a knot rendered with a cartoon-like shader.

You can download this demo here:

Download GeeXLab OpenGL 2.1 test for the Raspberry Pi

Just unzip the archive where you want and launch the executable:


A thread for any feedback / bug-report is available here. The source code of the demo (Lua + GLSL) is available in the opengl21-test/ folder if the zip archive.

If OpenGL is accelerated by the VideoCore IV GPU (GL_RENDERER: Gallium 0.4 on VC4), the rendering speed is around 160 FPS (the demo has a resolution of 400×400 pixels). With the software rasterizer (GL_RENDERER: Software Rasterizer), the rendering speed is around 2 or 3 FPS!

GeeXLab OpenGL 2.1 test on the Raspberry Pi with software rasterizer
OpenGL 2.1 with Software Rasterizer: 2 FPS

GeeXLab OpenGL 2.1 test on the Raspberry Pi with hardware rasterizer
OpenGL 2.1 with GPU accelerated rasterizer: 163 FPS

To enable or disable the OpenGL driver in the latest Raspbian, just launch the raspi-config utility in command line:

sudo raspi-config

Enabling the GL driver in raspi-config

Enabling the GL driver in raspi-config

The system needs a reboots to use the new settings.

GeeXLab comes with a code sample pack that includes a lot of OpenGL 2.1 demos that can be loaded with the OpenGL version of GeeXLab for Raspberry Pi. The code sample pack will be soon updated with separate folders for OpenGL ES 2.0, OpenGL 2.1, OpenGL 3, OpenGL 4 and Direct3D 12 demos to improve the browsing of the pack.

OpenGL 2.1 demo on Raspberry Pi
Random lines demo on the RPi