steering-wheel-rpi/include/App.h

45 lines
739 B
C
Raw Normal View History

2022-05-19 20:07:15 +02:00
#pragma once
#include "AMI.h"
#include <SDL2/SDL.h>
#include <memory>
constexpr int SCREEN_WIDTH = 480;
constexpr int SCREEN_HEIGHT = 320;
enum class AppView { AMI, DRIVER, TESTING };
class SDLManager {
public:
SDLManager();
~SDLManager();
};
class App {
public:
App();
~App();
int run();
private:
void init_sdl();
void handle_events();
void render();
// The SDLManager initializes & quits SDL and its subsystems. Thus, it must be
// the first member of the class, so that its constructor is called before the
// others and its destructor is called after the others.
SDLManager sdl_manager;
std::unique_ptr<AMI> ami;
bool running;
AppView view;
SDL_Window* window;
SDL_Renderer* renderer;
};