Expand description
Brings OpneGL-(ES) to wayrs.
Requires EGL 1.4 with the following extensions:
EGL_KHR_platform_gbmEGL_KHR_no_config_contextEGL_KHR_surfaceless_contextEGL_EXT_image_dma_buf_import_modifiersGL_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
DrmDeviceand createEglDisplayfor 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
EglContextusingEglContextBuilderand make it current. - Load graphics API functons using
egl_ffi::eglGetProcAddress. - Assert that
GL_OES_EGL_imageis supported. - Setup a framebuffer and a renderbuffer objects.
- Create a
BufferPoolwith 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§
- Buffer
- A GBM-allocated buffer
- Buffer
Pool - A pool of
Nbuffers. - DrmDevice
- A DRM device
- EglContext
- EGL graphics API context
- EglContext
Builder EglContextbuilder- EglDisplay
- GBM-based EGL display
- EglExtensions
- A set of EGL extensions
- Fourcc
- A DRM fourcc format wrapper with nice
Debugformatting