Skip to content

Instantly share code, notes, and snippets.

@BioBoost
Created December 21, 2022 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BioBoost/f07855d747ba47bda1dbe62cf6c91c8d to your computer and use it in GitHub Desktop.
Save BioBoost/f07855d747ba47bda1dbe62cf6c91c8d to your computer and use it in GitHub Desktop.
Rendering interface c++
class IRender {
virtual void render(Canvas *canvas) = 0;
};
///////////////////////////////////////////////////
class SenseHatRenderer : public IRender {
void render(Canvas * canvas) override {
// ....
}
};
///////////////////////////////////////////////////
// SenseHatRenderer renderer;
IRender * renderer = new SenseHatRenderer();
renderer->render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment