pass font to canvas.print(...)
This commit is contained in:
parent
58f3d1f02b
commit
3f3c40a9b1
2 changed files with 19 additions and 14 deletions
|
@ -14,23 +14,13 @@ private:
|
|||
const int width_;
|
||||
const int height_;
|
||||
public:
|
||||
canvas(int w, int h);
|
||||
|
||||
canvas(int w, int h) : width_(w), height_(h) {
|
||||
void draw(int x, int y);
|
||||
|
||||
}
|
||||
|
||||
void draw(int x, int y) {
|
||||
hal_draw(x, y);
|
||||
}
|
||||
|
||||
void print(int x, int y, const char *str) {
|
||||
basic_5x4.print(x, y, str, *this);
|
||||
}
|
||||
|
||||
void print(int x, int y, char *str) {
|
||||
basic_5x4.print(x, y, str, *this);
|
||||
}
|
||||
void print(int x, int y, const char *str, font& = basic_5x4);
|
||||
|
||||
void print(int x, int y, char *str, font& = basic_5x4);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -3,3 +3,18 @@
|
|||
//
|
||||
|
||||
#include "gfx/canvas.h"
|
||||
|
||||
canvas::canvas(int w, int h) : width_(w), height_(h) {
|
||||
}
|
||||
|
||||
void canvas::draw(int x, int y) {
|
||||
hal_draw(x, y);
|
||||
}
|
||||
|
||||
void canvas::print(int x, int y, const char *str, font& f) {
|
||||
f.print(x, y, str, *this);
|
||||
}
|
||||
|
||||
void canvas::print(int x, int y, char *str, font& f) {
|
||||
f.print(x, y, str, *this);
|
||||
}
|
Loading…
Reference in a new issue