-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphicsEngine.h
64 lines (45 loc) · 1.45 KB
/
graphicsEngine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* graphicsEngine.h
*
* Created on: 23.06.2017
* Author: Student225988
*/
#ifndef GRAPHICSENGINE_H_
#define GRAPHICSENGINE_H_
#include "pinconfig.h"
#include "display.h"
#define EMPTY_DRAWABLE 0b00100000
typedef unsigned DrawableObject;
// DISPLAY STATES -------------------------
typedef struct{
DrawableObject drawables[DISPLAY_SIZE];
} DrawableMap;
typedef struct{
unsigned leds[LED_DISPLAY_SIZE];
} LEDState;
// ---------------------------------------
// CUSTOM ASSETS --------------------------
typedef struct{
DrawableObject pixelLines[8];
} Asset;
// ---------------------------------------
// GRAPHIC ENGINE OBJECT-------------------
typedef struct{
DrawableMap previousMap;
DrawableMap bufferMap;
LEDState previousLEDState;
LEDState bufferLEDState;
Asset* assets;
unsigned assetsSize;
} GraphicsEngine;
// ---------------------------------------
// new interface
GraphicsEngine* graphicsEngineInit();
void prepareDraw(GraphicsEngine* engine, DrawableObject, unsigned x, unsigned y);
void prepareDrawString(GraphicsEngine* engine, char* characters, int length, unsigned x, unsigned y);
void prepareLEDDraw(GraphicsEngine* engine, int led);
void executeDraw(GraphicsEngine* engine);
void executeLEDDraw(GraphicsEngine* engine);
void loadAsset(GraphicsEngine*, Asset, DrawableObject);
void clearStateAndBuffers(GraphicsEngine* engine);
#endif /* GRAPHICSENGINE_H_ */