Zepha/src/client/Window.h

52 lines
697 B
C++

//
// Created by aurailus on 26/11/18.
//
#pragma once
#include <list>
#include "util/GL.h"
#include <GLFW/glfw3.h>
#include "util/Types.h"
#include "util/EventEmitter.h"
#include "Input.h"
namespace {
enum class WinEvt { Resize };
}
class Window : public EventEmitter<Event<WinEvt::Resize, ivec2>> {
public:
typedef WinEvt Event;
Window();
Window(ivec2 win);
void update();
bool shouldClose();
void swapBuffers();
ivec2 getSize();
void setCursorHand(bool hand);
~Window();
Input input;
GLFWwindow* mainWindow = nullptr;
private:
static void resizeCallback(GLFWwindow* window, i32 width, i32 height);
GLFWcursor* handCursor = nullptr;
ivec2 win;
};