2020-10-11 16:34:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class Emulator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Emulator(
|
|
|
|
const std::shared_ptr<SDL_Window> & window,
|
|
|
|
const std::shared_ptr<SDL_Renderer> & renderer,
|
|
|
|
const std::shared_ptr<SDL_Texture> & texture
|
|
|
|
);
|
|
|
|
|
|
|
|
void executeOneFrame();
|
|
|
|
void processEvents(bool & quit);
|
|
|
|
|
|
|
|
private:
|
2020-10-11 20:10:37 +01:00
|
|
|
void processKeyDown(const SDL_KeyboardEvent & key, bool & quit);
|
|
|
|
void processKeyUp(const SDL_KeyboardEvent & key);
|
|
|
|
void processText(const SDL_TextInputEvent & text);
|
2020-10-11 16:34:19 +01:00
|
|
|
|
|
|
|
const std::shared_ptr<SDL_Window> myWindow;
|
|
|
|
const std::shared_ptr<SDL_Renderer> myRenderer;
|
|
|
|
const std::shared_ptr<SDL_Texture> myTexture;
|
|
|
|
const int myFPS;
|
|
|
|
|
|
|
|
int myMultiplier;
|
|
|
|
bool myFullscreen;
|
|
|
|
};
|