如何使用 clutter 直接渲染到 linux framebuffer?

How to use clutter to render directly to linux framebuffer?

Gnome Clutter 网站是这样说的:

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

所以 Clutter 显然可以直接渲染到 Linux 帧缓冲区。如何在 Linux 直接渲染到帧缓冲区的过程中进行配置并使工作变得混乱?是否需要使用特殊配置等构建 Clutter?

是的,您需要使用 EGL 本机后端构建 Clutter。您还需要一种访问帧缓冲设备的方法,这通常取决于驱动程序。

首先,您需要使用 --enable-null-egl-platform 选项构建支持 "null" EGL 平台的 Cogl; and/or KMS EGL 平台,使用--enable-kms-egl-platform。这取决于您的目标平台。通常,较旧的二进制 blob 驱动程序将使用 "null" EGL 后端,而较新的免费软件驱动程序将公开 KMS API 以设置帧缓冲区。

构建 Cogl 后,您需要使用 --enable-egl-backend 配置选项在启用 EGL 后端的情况下构建 Clutter。

如果一切顺利,您现在应该能够启动 Clutter 示例或直接在帧缓冲区上测试渲染。