48 lines
845 B
C++
48 lines
845 B
C++
#ifndef WC3RE_RENDER_RENDERER_HH__
|
|
#define WC3RE_RENDER_RENDERER_HH__
|
|
|
|
#include <memory>
|
|
|
|
#include "sdlutil.hh"
|
|
#include "AlResource.hh"
|
|
|
|
namespace game {
|
|
class GameState;
|
|
}
|
|
|
|
namespace render {
|
|
class Overlay;
|
|
|
|
class Renderer {
|
|
public:
|
|
Renderer();
|
|
~Renderer();
|
|
|
|
void run();
|
|
|
|
int getWidth() const;
|
|
int getHeight() const;
|
|
|
|
void pushGS(std::unique_ptr<game::GameState> gs);
|
|
std::unique_ptr<game::GameState> popGS();
|
|
private:
|
|
SDLInit sdlInit_;
|
|
TTFInit ttfInit_;
|
|
SDLWindowUPtr window_;
|
|
SDLGLContext context_;
|
|
std::vector<std::unique_ptr<game::GameState> > gamestates_;
|
|
int width_, height_;
|
|
|
|
ALCDeviceUPtr alcDevice_;
|
|
ALCContextUPtr alcContext_;
|
|
|
|
TTFFontUPtr fpsFont_;
|
|
std::unique_ptr<Overlay> fpsOverlay_;
|
|
SDLSurfaceUPtr fpsOverlaySurf_;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|