42 lines
776 B
C++
42 lines
776 B
C++
//
|
|
// Created by jedi on 11/1/18.
|
|
//
|
|
|
|
#pragma once
|
|
|
|
#include "hal/hal.h"
|
|
#include "gfx/Font.h"
|
|
#include "fonts/basic_5x4.h"
|
|
#include "gfx/Buffer.h"
|
|
|
|
namespace micromenu {
|
|
|
|
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 = false, Font & = basic_5x4);
|
|
|
|
void print(int x, int y, char *str, bool inv = false, Font & = basic_5x4);
|
|
|
|
int getWidth();
|
|
|
|
int getHeight();
|
|
|
|
friend Screen;
|
|
};
|
|
|
|
}
|