2020-10-11 16:34:19 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
#include <memory>
|
|
|
|
|
2020-11-20 15:32:35 +00:00
|
|
|
#include "frontends/common2/speed.h"
|
|
|
|
|
2021-01-10 11:47:44 +00:00
|
|
|
class SDLFrame;
|
|
|
|
|
2020-10-11 16:34:19 +01:00
|
|
|
class Emulator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Emulator(
|
2021-01-10 11:47:44 +00:00
|
|
|
const std::shared_ptr<SDLFrame> & frame,
|
2020-11-21 15:07:31 +00:00
|
|
|
const bool fixedSpeed
|
2020-10-11 16:34:19 +01:00
|
|
|
);
|
|
|
|
|
2020-11-20 15:32:35 +00:00
|
|
|
void execute(const size_t milliseconds);
|
2020-11-30 13:38:56 +00:00
|
|
|
|
2020-10-11 16:34:19 +01:00
|
|
|
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
|
|
|
|
2021-01-10 11:47:44 +00:00
|
|
|
const std::shared_ptr<SDLFrame> myFrame;
|
2020-10-11 16:34:19 +01:00
|
|
|
|
|
|
|
int myMultiplier;
|
|
|
|
bool myFullscreen;
|
2020-11-20 15:32:35 +00:00
|
|
|
|
|
|
|
Speed mySpeed;
|
2020-10-11 16:34:19 +01:00
|
|
|
};
|