aboutsummaryrefslogtreecommitdiffstats
path: root/hal/sdl2/display.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'hal/sdl2/display.hpp')
-rw-r--r--hal/sdl2/display.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/hal/sdl2/display.hpp b/hal/sdl2/display.hpp
new file mode 100644
index 0000000..55d82b7
--- /dev/null
+++ b/hal/sdl2/display.hpp
@@ -0,0 +1,30 @@
+#pragma once
+#ifdef SDL2_BUILD
+#include <SDL.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);
+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
+