5

I tried to follow this tutorial. But when I execute it I have this error :

> * failed to add service - already in use ?

The memory split is equal to 192Mb and the Pi is connected by HDMI to a monitor.

One more question, is it better to do OpenGL ES 2.0 with EGL or GLFW/GLEW ?

Darth Vader
  • 4,218
  • 24
  • 47
  • 70
Vipe
  • 51
  • 3

1 Answers1

2

That tutorial uses the old Broadcom EGL libraries (/opt/vc), which was all that was available in 2012. Modern Raspbian is often configured for the Mesa open-source driver, leading to a failed to add service error when attempting to run a program built for the former.

If you had enabled the full OpenGL driver at any point, you can run sudo raspi-config, revert to the legacy driver, and reboot.

It's also possible to port old projects like this one to run on Mesa EGL, but the difficulty varies depending on the codebase. A starting point would be to remove the -L/opt/vc/lib and -I/opt/vc/include references and run sudo apt install libegl1-mesa-dev libgles2-mesa-dev to install the appropriate libraries.

One more question, is it better to do OpenGL ES 2.0 with EGL or GLFW/GLEW ?

That's a loaded question and depends on your needs. One way to look at it: a GLES application written for the Pi could potentially run on other single-board computers that may lack support for full OpenGL. A GLFW/GLEW program could likewise be handy to build and test on a desktop Linux computer.

jdonald
  • 2,972
  • 14
  • 39