Expand description
Brings OpneGL-(ES) to wayrs
.
Requires EGL 1.5 with the following extensions:
EGL_KHR_platform_gbm
EGL_KHR_no_config_context
EGL_KHR_surfaceless_context
EGL_EXT_image_dma_buf_import_modifiers
GL_OES_EGL_image
Usage
- Subscribe to
zwp_linux_dmabuf_feedback_v1
(for example, usingwayrs_utils::dmabuf_feedback::DmabufFeedback
). - When feedback is received, get the render node path using
DrmDevice
and createEglDisplay
for the given path. - Select buffer formats that where advertised by dmabuf feedback and are supported by
EglDisplay
. From these formats choose the one you will use. - Create
EglContext
usingEglContextBuilder
and make it current. - Load graphics API functons using
egl_ffi::eglGetProcAddress
. - Assert that
GL_OES_EGL_image
is supported. - Setup a framebuffer and a renderbuffer objects.
- Create a
BufferPool
with the desired number of buffers. Three may be a good choice. This step is optional, you may manually manage your buffers.
Before rendering, select a free Buffer
and link it to your renderbuffer object using
Buffer::set_as_gl_renderbuffer_storage
. After rendering, attach and commit
Buffer::wl_buffer
.
See an example in examples/triangle.rs
.
Modules
Structs
- A GBM-allocated buffer
- A pool of
N
buffers. - A DRM device
- EGL graphics API context
EglContext
builder- GBM-based EGL display
- A set of EGL extensions
- A DRM fourcc format wrapper with nice
Debug
formatting