-
Notifications
You must be signed in to change notification settings - Fork 9
OpenGL
Frank Bauernöppel edited this page Dec 3, 2017
·
18 revisions
Raspi VC4 hardware supports
- OpenGLES (https://www.khronos.org/opengles/) 1.1 and 2.0 and
- only a subset of OpenGL 2.1 (https://www.khronos.org/registry/OpenGL/specs/gl/glspec21.pdf)
OpenGLES is a subset of OpenGL for embbeded systems (ES), but many applications, especially games, rely on a fully supported OpenGL API. There are efforts to support all of OpenGL, see https://github.com/anholt/mesa/wiki/VC4-OpenGL-support with additional drivers (work in progress).
The images are configured to use the following software stack:
- OpenGLES client application like a Qt5 application or a SDL2 game.
- OpenGLES for 3D accelerated rendering (see
/usr/include/GLES2/
header files) -
EGL as interface layer between the rendering API and the native platform windowing API (see
/usr/include/EGL/
headers) - framebuffer as native platform API for graphical output
Examples from Munshi, Ginsburg, Shriner "OpenGL ES 2.0 Programming Guide". Forked from benosteen/opengles-book-samples:
root@raspberrypi3:~# git clone https://github.com/FrankBau/opengles-book-samples/
root@raspberrypi3:~# cd opengles-book-samples/Raspi
root@raspberrypi3:~/opengles-book-samples/Raspi# make
root@raspberrypi3:~/opengles-book-samples/Raspi# Chapter_2/Hello_Triangle/CH02_HelloTriangle
123 frames rendered in 2.0033 seconds -> FPS=61.3986
...
The famous red triangle is displayed on HDMI monitor. Rendering is synchronized to 60Hz display refresh rate.