// somebar - dwl bar // See LICENSE file for copyright and license details. #pragma once #include #include // double buffered shm // format is must be 32-bit class ShmBuffer { struct Buf { uint8_t *data {nullptr}; wl_buffer *buffer {nullptr}; }; std::array _buffers; int _current {0}; size_t _totalSize {0}; public: int width, height, stride; explicit ShmBuffer(int width, int height, wl_shm_format format); uint8_t* data() const; wl_buffer* buffer() const; void flip(); ~ShmBuffer(); };