we render a point!!!

This commit is contained in:
Emanuele Trabattoni
2021-05-26 23:38:07 +02:00
parent 9f1990b977
commit 8325dcfdd8
6 changed files with 122 additions and 62 deletions

View File

@@ -7,7 +7,10 @@ namespace Render {
_parent(parent),
_engine(engine)
{
printf("Created Drawable id: %d\n", _id);
}
Drawable::~Drawable() {
}
//--------+--------+--------+--------+--------+--------+--------+--------+--------+--------//
@@ -19,17 +22,22 @@ namespace Render {
}
DrawablePoint::~DrawablePoint() {
}
void DrawablePoint::render() {
uint8_t *buf;
if (parent() == nullptr)
buf = engine()->bBuffer();
else
buf = engine()->fBuffer();
//TODO: implement screen rotation and margin check
auto dx = engine()->getSize().x;
for (uint16_t xx(0); xx< _size.x; xx++){
for (uint16_t yy(0); yy < _size.y; yy++)
{
engine()->setPixel(buf,getOrigin().x+xx,getOrigin().y+yy,true);
engine()->setPixel(buf,dx-(getOrigin().x+xx),getOrigin().y+yy,true);
}
}
}