Diggler/GameWindow.hpp
Dorian Wouters f2062d6fe7 Faster atlas creation
Block selection
Chunk de/compression now uses internal buffer directly (0-copy)
Optimized Chunk vertices list order (faster vert access from GPU cache)
F5 Debug info: added triangle count
Implemented ladder climb
Road + jump pad makes you jump farther
Fixed bad fog color blending (alpha-channel)
Changed LZFX and enet compilation to Release, -O3
2016-01-02 20:03:37 +01:00

60 lines
1.2 KiB
C++

#ifndef GAME_WINDOW_HPP
#define GAME_WINDOW_HPP
#include <alc.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <memory>
#include <glm/detail/type_mat.hpp>
#include "Platform.hpp"
#include "ui/Manager.hpp"
using std::shared_ptr;
namespace Diggler {
class Game;
class State;
class GameWindow {
private:
static int InstanceCount;
static bool IsGlewInited;
GLFWwindow *m_window;
int m_w, m_h;
shared_ptr<State> m_currentState, m_nextState;
public:
UI::Manager UIM;
Game *G;
GameWindow(Game*);
~GameWindow();
operator GLFWwindow&() const { return *m_window; }
operator GLFWwindow*() const { return m_window; }
inline int getW() const { return m_w; }
inline int getH() const { return m_h; }
bool shouldClose() const;
void cbMouseButton(int key, int action, int mods);
void cbCursorPos(double x, double y);
void cbMouseScroll(double x, double y);
void cbKey(int key, int scancode, int action, int mods);
void cbChar(char32 unichar);
void cbResize(int w, int h);
void updateViewport();
void setNextState(const shared_ptr<State> next);
void run();
void showMessage(const std::string &msg, const std::string &submsg = "");
};
}
#endif