-
Notifications
You must be signed in to change notification settings - Fork 4
/
RootDisplay.hpp
74 lines (55 loc) · 1.53 KB
/
RootDisplay.hpp
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
65
66
67
68
69
70
71
72
73
74
#pragma once
#include "Element.hpp"
#include "colorspaces.hpp"
#include <unordered_map>
#if defined(_3DS) || defined(_3DS_MOCK)
#define ICON_SIZE 48
#else
#define ICON_SIZE 150
#endif
#define SCREEN_WIDTH RootDisplay::screenWidth
#define SCREEN_HEIGHT RootDisplay::screenHeight
class RootDisplay : public Element
{
public:
RootDisplay();
virtual ~RootDisplay();
bool process(InputEvents* event);
void render(Element* parent);
void update();
int mainLoop();
void initMusic();
void startMusic();
void setScreenResolution(int width, int height);
static CST_Renderer* renderer;
static CST_Window* window;
static RootDisplay* mainDisplay;
static void switchSubscreen(Element* next);
static Element* subscreen;
static Element* nextsubscreen;
// dimensions of the screen, which can be modified
static int screenWidth;
static int screenHeight;
static float dpiScale;
// if enabled, the cursor will pulse when idle
// this uses more energy and forces more redraws
// TODO: enable or disable based on battery level or user preference
static bool idleCursorPulsing;
static bool isDebug;
bool isRunning = true;
bool exitRequested = false;
bool canUseSelectToExit = false;
int lastFrameTime = 99;
SDL_Event needsRender;
// our main input events
InputEvents* events = NULL;
std::function<void()> windowResizeCallback = NULL; // Called when the window is resized
#if defined(__WIIU__)
void processWiiUHomeOverlay();
#endif
std::vector<Element*> trash;
void recycle();
#if defined(MUSIC)
Mix_Music* music = NULL;
#endif
};