2013-04-08 14:41:25 +00:00
|
|
|
#ifndef _WINDOW_H_
|
|
|
|
#define _WINDOW_H_
|
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
#include "GuiComponent.h"
|
2013-04-08 14:41:25 +00:00
|
|
|
#include "InputManager.h"
|
2013-06-21 16:49:29 +00:00
|
|
|
#include "resources/ResourceManager.h"
|
2013-04-08 14:41:25 +00:00
|
|
|
#include <vector>
|
2013-07-09 05:44:24 +00:00
|
|
|
#include "Font.h"
|
2013-04-08 14:41:25 +00:00
|
|
|
|
|
|
|
class Window
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Window();
|
|
|
|
~Window();
|
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
void pushGui(GuiComponent* gui);
|
|
|
|
void removeGui(GuiComponent* gui);
|
|
|
|
GuiComponent* peekGui();
|
2013-04-08 14:41:25 +00:00
|
|
|
|
|
|
|
void input(InputConfig* config, Input input);
|
|
|
|
void update(int deltaTime);
|
|
|
|
void render();
|
|
|
|
|
2013-07-09 10:37:37 +00:00
|
|
|
bool init(unsigned int width = 0, unsigned int height = 0);
|
2013-04-08 17:40:15 +00:00
|
|
|
void deinit();
|
|
|
|
|
2013-04-08 14:41:25 +00:00
|
|
|
InputManager* getInputManager();
|
2013-06-21 16:49:29 +00:00
|
|
|
ResourceManager* getResourceManager();
|
2013-04-08 14:41:25 +00:00
|
|
|
|
2013-07-17 06:47:02 +00:00
|
|
|
void normalizeNextUpdate();
|
|
|
|
|
2013-08-06 13:15:20 +00:00
|
|
|
void setZoomFactor(const float& zoom);
|
|
|
|
void setCenterPoint(const Eigen::Vector2f& point);
|
|
|
|
|
|
|
|
void setFadePercent(const float& perc);
|
|
|
|
|
2013-04-08 14:41:25 +00:00
|
|
|
private:
|
|
|
|
InputManager* mInputManager;
|
2013-06-02 15:08:32 +00:00
|
|
|
std::vector<GuiComponent*> mGuiStack;
|
2013-07-03 07:54:55 +00:00
|
|
|
|
|
|
|
std::vector< std::shared_ptr<Font> > mDefaultFonts;
|
2013-07-17 06:47:02 +00:00
|
|
|
|
|
|
|
int mFrameTimeElapsed;
|
|
|
|
int mFrameCountElapsed;
|
|
|
|
int mAverageDeltaTime;
|
|
|
|
std::string mFrameDataString;
|
|
|
|
|
|
|
|
bool mNormalizeNextUpdate;
|
2013-08-06 13:15:20 +00:00
|
|
|
|
|
|
|
float mZoomFactor;
|
|
|
|
Eigen::Vector2f mCenterPoint;
|
|
|
|
|
|
|
|
void updateMatrix();
|
|
|
|
Eigen::Affine3f mMatrix;
|
|
|
|
|
|
|
|
void postProcess();
|
|
|
|
float mFadePercent;
|
2013-04-08 14:41:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|