does not link, we are close..
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
/*******************************************
|
||||
* Most Awesome Renderer Ever
|
||||
*******************************************/
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pico/stdlib.h>
|
||||
|
||||
extern "C" {
|
||||
#include <DEV_Config.h>
|
||||
#include <EPD_2in9_V2.h>
|
||||
#include <fonts.h>
|
||||
}
|
||||
|
||||
#include <vector>
|
||||
@@ -52,9 +53,11 @@ namespace Render{
|
||||
|
||||
class Mare {
|
||||
friend class Drawable;
|
||||
friend class Page;
|
||||
|
||||
Mare(dim_t size);
|
||||
~Mare();
|
||||
public:
|
||||
Mare(dim_t size);
|
||||
~Mare();
|
||||
|
||||
// getters, setters
|
||||
public:
|
||||
@@ -67,8 +70,8 @@ namespace Render{
|
||||
|
||||
// drawables, pages
|
||||
public:
|
||||
template <class T>
|
||||
void addDrawable(T);
|
||||
template <class T, class ... Args>
|
||||
T* addDrawable(Args&&... args);
|
||||
void removeDrawable(const size_t id);
|
||||
void addPage();
|
||||
void removePage(const uint8_t num);
|
||||
@@ -77,9 +80,11 @@ namespace Render{
|
||||
|
||||
//render
|
||||
private:
|
||||
void render();
|
||||
void clearBuffer(uint8_t* buffer, Color col);
|
||||
void visitDrawables(Drawable* parent);
|
||||
|
||||
public:
|
||||
void render();
|
||||
void setPixel(uint8_t* img, uint16_t x, uint16_t y, bool value);
|
||||
|
||||
// members
|
||||
@@ -90,11 +95,15 @@ namespace Render{
|
||||
uint8_t* _screenBufferBackground;
|
||||
Drawables _drawables; // background drawables for all the pages
|
||||
ScreenRotation _rotation;
|
||||
|
||||
public:
|
||||
uint8_t* bBuffer() {return _screenBufferBackground;}
|
||||
uint8_t* fBuffer() {return _screenBufferForeground;}
|
||||
};
|
||||
|
||||
class Drawable {
|
||||
public:
|
||||
Drawable(const size_t id, const Drawable* parent, const Mare* engine);
|
||||
Drawable(const size_t id, Drawable* parent, Mare* engine);
|
||||
~Drawable();
|
||||
|
||||
public:
|
||||
@@ -106,12 +115,16 @@ namespace Render{
|
||||
void setDirty();
|
||||
void setBlendMode(const BlendMode mode);
|
||||
|
||||
const pos_t getOrigin();
|
||||
const bbox2d_t getBBox();
|
||||
const BlendMode getBlendMode();
|
||||
|
||||
Mare* engine() { return _engine; };
|
||||
Drawable* parent() { return _parent; };
|
||||
|
||||
private:
|
||||
const Drawable* _parent;
|
||||
const Mare* _engine;
|
||||
Drawable* _parent;
|
||||
Mare* _engine;
|
||||
bool _dirty;
|
||||
size_t _id;
|
||||
pos_t _origin;
|
||||
@@ -121,7 +134,7 @@ namespace Render{
|
||||
|
||||
class DrawablePoint: public Drawable {
|
||||
|
||||
DrawablePoint(const size_t id, const Drawable* parent, const Mare* engine, dim_t size);
|
||||
DrawablePoint(const size_t id, Drawable* parent, Mare* engine, dim_t size);
|
||||
~DrawablePoint();
|
||||
|
||||
public:
|
||||
@@ -240,6 +253,5 @@ namespace Render{
|
||||
private:
|
||||
Drawables _backDrawables;
|
||||
Drawables _frontDrawables;
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user