blob: e9302bcd79c36c9a429c95ef0c49cf1b1edbdbe6 (
plain)
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
|
#pragma once
#ifdef SDL2_BUILD
#include <SDL.h>
#include "pico/types.h"
class SDLDisplay {
public:
SDLDisplay();
~SDLDisplay();
// bool init_display();
// When returning false, please quit the program (return from main)
bool update_display(const uint8_t* oled_screen);
bool process_input();
bool get_datetime(datetime_t* t);
private:
SDL_Window* m_window = nullptr;
SDL_Renderer* m_renderer = nullptr;
SDL_Surface* m_surface = nullptr;
SDL_Texture* m_texture = nullptr;
bool m_should_quit = false;
bool m_testbool = false;
// Convert the surface's pixels from the internal SSOLED display representation
// to a valid representation that can be correctly displayed
void convert_display(const uint8_t* oled_screen);
// Get the gpio button that corresponds to the key that has been pressed
uint get_button(SDL_Keycode key);
};
#endif
|