rethink static uint8_t sBuffer[(HEIGHT*WIDTH)/8];
joshgoebel opened this issue · 2 comments
Could we rethink making this static? I have a case where I want to use the Arduboy2Base just to boot the system and use some of the nice drawing routines but then after boot-up I'm using a completely custom render stack (no need for buffer).
Making this static forces it to be a global so there is no way for release that memory.
The screen buffer has been static in this library since the first public release. It is documented in the API as such, so changing it could break anything using it directly instead of via an instance.
One reason it was made static is that doing so saves quite a bit of program memory in many sketches, so changing it could also cause program size problems with those.
The scenario mentioned is not typical. In this case, it would probably be best to use the Arduboy2Core class from the library and a customised local copy of Arduboy2Base. Or, for multiple sketch use, create a customised library derived from a fork.
Goes thru old issues? :)