micromenu/inc/gfx/canvas.h
2018-11-06 16:06:05 +01:00

42 lines
649 B
C++

//
// Created by jedi on 11/1/18.
//
#ifndef MGL_DMXMENU_CANVAS_H
#define MGL_DMXMENU_CANVAS_H
#include "hal/hal.h"
#include "gfx/font.h"
#include "fonts/basic_5x4.h"
#include "gfx/buffer.h"
class screen;
class canvas {
private:
const int width_;
const int height_;
buffer<_1bit> buffer_;
void draw_onto_(screen &);
public:
canvas(int w, int h);
void clear();
void draw(int x, int y);
void print(int x, int y, const char *str, font & = basic_5x4);
void print(int x, int y, char *str, font & = basic_5x4);
int getWidth();
int getHeight();
friend screen;
};
#endif //MGL_DMXMENU_CANVAS_H