28 lines
564 B
C++
28 lines
564 B
C++
#pragma once
|
|
#include "Display.h"
|
|
#include <linux/fb.h>
|
|
|
|
namespace Platform
|
|
{
|
|
class FBDisplay : public IDisplay
|
|
{
|
|
private:
|
|
int fb_fd = -1;
|
|
uint8_t* fb_mem = nullptr;
|
|
size_t fb_size = 0;
|
|
fb_var_screeninfo vinfo;
|
|
fb_fix_screeninfo finfo;
|
|
int width = 0;
|
|
int height = 0;
|
|
|
|
uint32_t convert_pixel(uint32_t rgba) const;
|
|
|
|
public:
|
|
bool init(int w, int h) override;
|
|
void present(const Core::FrameBuffer* framebuffer) override;
|
|
void poll_events(bool& should_quit) override;
|
|
uint32_t get_time_ms() const override;
|
|
void shutdown() override;
|
|
};
|
|
}
|