#raspberry-pi #rpi #bcm #videocore #broadcom

rpi_window

Raspberry Pi window initialization for GPU rendering

2 stable releases

1.0.1 Mar 11, 2021

#1408 in Hardware support

Apache-2.0

15KB
175 lines

Dispmanx window for EGL/GL on the Raspberry Pi

This is an extremely trimmed fork of videocore for opening a window to render with EGL/OpenGL ES. If you need to use more of the VC API than this crate exposes, use the original videcore crate instead.

Usage

Call bcm_host::init, create a dispmanx::Rect for src and dest, create a dispmanx::VCAlpha, and call dispmanx::create_window which returns a window struct which can be passed to eglCreateWindowSurface.

See examples for details.

When building, make sure pkg-config can find the driver userspace libraries. Build with the envvar PKG_CONFIG_LIBDIR set to /opt/vc/lib/pkgconfig, and PKG_CONFIG_ALLOW_CROSS set to 1 if necessary. See pkg-config-rs for details.

For example: to build and run the example on a Raspberry Pi, run

PKG_CONFIG_LIBDIR=/opt/vc/lib/pkgconfig cargo run --example gles2

No runtime deps