summaryrefslogtreecommitdiff
path: root/include/object
diff options
context:
space:
mode:
Diffstat (limited to 'include/object')
-rw-r--r--include/object/framebuffer.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/object/framebuffer.h b/include/object/framebuffer.h
index 6eac7e0..a76a24a 100644
--- a/include/object/framebuffer.h
+++ b/include/object/framebuffer.h
@@ -1,11 +1,20 @@
#pragma once
+#include "object/outputstream.h"
-class Framebuffer
+typedef const unsigned char* glyph_t;
+
+class Framebuffer : public OutputStream
{
+ private:
+ Framebuffer(Framebuffer& copy);
+ const glyph_t *font;
+ unsigned int fontX, fontY;
+ unsigned char scale;
+
public:
unsigned char *data;
- Framebuffer(unsigned char *data) : data(data) {}
+ Framebuffer(unsigned char *data) : font(0), fontX(0), fontY(0), scale(1), data(data) {}
constexpr static unsigned int const width = CONFIG_framebuffer_width;
constexpr static unsigned int const height = CONFIG_framebuffer_height;
@@ -13,9 +22,9 @@ class Framebuffer
void clear();
void fillBox(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
void drawAt(unsigned int x, unsigned int y, unsigned int w, unsigned int h, unsigned char *image);
-
- private:
- Framebuffer(Framebuffer& copy);
+ void setFont(const glyph_t *font) { this->font = font; }
+ void setPos(unsigned int newX, unsigned int newY) { fontX = newX; fontY = newY; }
+ virtual void put(char c) override;
};
extern Framebuffer fb;