Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why are methods such as drawChar() not virtual? #87

Open
jayeye opened this issue Jun 6, 2016 · 1 comment
Open

Why are methods such as drawChar() not virtual? #87

jayeye opened this issue Jun 6, 2016 · 1 comment

Comments

@jayeye
Copy link

jayeye commented Jun 6, 2016

Is it to reduce the memory footprint on memory-starved cores? I have several good reasons to override some of them, in particular, if I'm using a monospaced font, it makes sense to be able to override drawChar() so it first clears the off-pixels of the bounding box of the largest character in the font, rather than blink the entire string.

Shall I send a pull request?

@kyle-emmerich
Copy link

Virtual functions are pretty costly even when you're writing code for high-end x86-64 CPUs. You definitely don't want that kind of overhead on a microcontroller.

In fact, on a microcontroller, I would want the smallest possible library footprint. This one is already fairly large; coupled with the driver for the display itself, I'm using about 35% of my 32K!

If you want some specific functionality, you might just want to fork it and implement it separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants