Initial commit
This commit is contained in:
45
include/App.h
Normal file
45
include/App.h
Normal file
@ -0,0 +1,45 @@
|
||||
#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;
|
||||
};
|
||||
Reference in New Issue
Block a user