does not link, we are close..

This commit is contained in:
Emanuele Trabattoni
2021-05-25 22:35:25 +02:00
parent f5ce925153
commit 9f1990b977
6 changed files with 64 additions and 45 deletions

View File

@@ -38,10 +38,13 @@ namespace Render {
free(_screenBufferForeground);
}
template <class T>
void Mare::addDrawable(T){
template <class T, class ... Args>
T* Mare::addDrawable(Args&&... args){
static size_t lastDrawableIndex(0);
auto newD = std::make_shared<T>(lastDrawableIndex++, )
static_assert(std::is_base_of_v<Drawable, T>, "Scene::createDrawable<T>() error, type T is not inherited from Drawable.");
auto newD = std::make_shared<T>(lastDrawableIndex++, nullptr, this, std::forward<Args>(args)...);
_drawables.push_back(newD);
return newD.get();
}
@@ -54,6 +57,7 @@ namespace Render {
printf("Drawable is expired");
}
}
EPD_2IN9_V2_Display_Partial(_screenBufferBackground);
}
void Mare::setPixel(uint8_t* img, uint16_t x, uint16_t y, bool value){