linuxopengl-esframebufferyoctoclutter

How to use clutter to render directly to linux framebuffer?


The Gnome Clutter website says the following:

Runs on Linux, Windows and OSX with native backend window system support for GLX, EGL (both on X11 and framebuffer surfaces), WGL and Cocoa.

So Clutter can apparently render directly to the Linux framebuffer. How does one configure and get clutter working in Linux rendering directly to the framebuffer? Does Clutter need to be built using special configuration etc?


Solution

  • Yes, you need to build Clutter with the EGL native backend. You also need a way to access the framebuffer device, which is usually driver dependent.

    First of all, you need to build Cogl with support for the "null" EGL platform, using the --enable-null-egl-platform option; and/or the KMS EGL platform, using the --enable-kms-egl-platform. This depends on the platform you're targeting. Usually, older binary blob drivers will use the "null" EGL backend, whereas newer free software drivers will expose the KMS API for setting up the framebuffer.

    After building Cogl, you will need to build Clutter with the EGL backend enabled, using the --enable-egl-backend configuration option.

    If everything went well, you should now be able to launch a Clutter example or test rendering directly on the framebuffer.