I’m struggling to integrate SmartMatrix with Adafruit GFX because my object needs to receive backgroundLayer as an argument, and it seems to be a complex template thing (not a fan of C++ templates, they make life such a pain, or maybe I’m just not smart enough, or both ).
I can’t send it as an argument without a type (with FastLED, it was simple, it was simply
SmartMatrix_GFX::SmartMatrix_GFX(CRGB *leds, uint8_t w, uint8_t h):
Anyway, I found:
SmartMatrix3<pwm_depth, width, height, panel_type, option_flags> matrix_name
If I read this right, depth, size, type and options are all template arguments which means they need to be constant values at compile time. In turn, it seems impossible to pass backgroundlayer because I can’t define it in a library which does not know those arguments which can’t be defined at calling time but must be known at compile time, so I can’t define the type in the function signature.
Am I correct, is my effort more or less doomed?
For more context, this is what I’m trying to do
(as written for FastLED)
Also, I’m not super clear about how the base layer, SMARTMATRIX_ALLOCATE_BUFFERS(matrix …
is used and whether I need it if I only want/need a single dumb layer. Is it required because you write to backgroundlayer and then swapbuffers copies the contents to matrix which is used to run the actual display?