-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.h
More file actions
51 lines (41 loc) · 1.02 KB
/
App.h
File metadata and controls
51 lines (41 loc) · 1.02 KB
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
#pragma once
#include "Color.h"
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <SPI.h>
//#include "Kernel.h"
class Kernel;
//Common framework for apps so that Kernel can call them easily
//More akin to a Rust traits than a real class
class App {
virtual void _setup_sprites();
public:
App(Kernel* kernel);
virtual void run_code(double x, double y, bool special)=0;
virtual String get_name() = 0;
};
// Utility function to make sprites easily
void make_sprite(TFT_eSprite*& spr, TFT_eSPI* display, int width, int height, const uint16_t bitmap[]);
//New app copy and paste
/* newApp.h
#include "App.h"
class Kernel;
class newApp : public App
{
Kernel* kernel;
public:
newApp(Kernel* kernel);
void run_code(double x, double y, bool special);
String get_name();
};
* newApp.cpp
#include "newApp.h"
#include "Kernel.h"
newApp::newApp(Kernel* kernel) : App(kernel) {
this->kernel = kernel;
}
void newApp::run_code(double x, double y, bool special) {}
String newApp::get_name() {
return String("newApp");
}
*/