#ifndef DISPLAY_SCREEN_H
#define DISPLAY_SCREEN_H
#include <stdio.h>
#include <stdlib.h>
#include "Constants.h"
#include "ColourPalette.hpp"
#include "../emucore/MediaSrc.hxx"
#ifdef __USE_SDL
#include "SDL.h"
namespace ale {
class DisplayScreen {
public:
DisplayScreen(MediaSource* mediaSource, Sound* sound, ColourPalette& palette);
virtual ~DisplayScreen();
void display_screen();
bool manual_control_engaged() { return manual_control_active; }
Action getUserAction();
protected:
void poll();
void handleSDLEvent(const SDL_Event& event);
protected:
static const int window_height = 321;
static const int window_width = 428;
bool manual_control_active;
MediaSource* media_source;
Sound* my_sound;
ColourPalette& colour_palette;
int screen_height, screen_width;
SDL_Surface *screen, *image;
float yratio, xratio;
Uint32 delay_msec;
Uint32 last_frame_time;
};
}
#else
namespace ale {
class DisplayScreen {
public:
DisplayScreen(MediaSource*, Sound*, ColourPalette&) {}
void display_screen() {}
bool manual_control_engaged() { return false; }
Action getUserAction() { return UNDEFINED; }
};
}
#endif
#endif