Crate wayrs_egl

Source
Expand description

Brings OpneGL-(ES) to wayrs.

Requires EGL 1.5 with the following extensions:

§Usage

  1. Subscribe to zwp_linux_dmabuf_feedback_v1 (for example, using wayrs_utils::dmabuf_feedback::DmabufFeedback).
  2. When feedback is received, get the render node path using DrmDevice and create EglDisplay for the given path.
  3. Select buffer formats that where advertised by dmabuf feedback and are supported by EglDisplay. From these formats choose the one you will use.
  4. Create EglContext using EglContextBuilder and make it current.
  5. Load graphics API functons using egl_ffi::eglGetProcAddress.
  6. Assert that GL_OES_EGL_image is supported.
  7. Setup a framebuffer and a renderbuffer objects.
  8. 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§

egl_ffi

Structs§

Buffer
A GBM-allocated buffer
BufferPool
A pool of N buffers.
DrmDevice
A DRM device
EglContext
EGL graphics API context
EglContextBuilder
EglContext builder
EglDisplay
GBM-based EGL display
EglExtensions
A set of EGL extensions
Fourcc
A DRM fourcc format wrapper with nice Debug formatting

Enums§

EglError
Error
GraphicsApi

Type Aliases§

Result