42 lines
695 B
C++
42 lines
695 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, bool inv = false);
|
|
|
|
void print(int x, int y, const char *str, bool inv = 0, font & = basic_5x4);
|
|
|
|
void print(int x, int y, char *str, bool inv = 0, font & = basic_5x4);
|
|
|
|
int getWidth();
|
|
|
|
int getHeight();
|
|
|
|
friend screen;
|
|
};
|
|
|
|
|
|
#endif //MGL_DMXMENU_CANVAS_H
|