#pragma once
#include "common.hpp"
#include <GL/glew.h>
#include <GLFW/glfw3.h>


bool glerr(const char* = NULL, bool always=false);

class Window {
    private:
        static Window* inst;
        Window(GLFWwindow* win, int ww, int hh): window(win), w(ww), h(hh) {}

    public:
        GLFWwindow* const window;
        const unsigned w, h;

        static Window* getInst(unsigned, unsigned, bool, const char*);
        ~Window();

        bool shouldClose() const;
        void shouldClose(bool);
        void draw();

        GLfloat px2iso_x(unsigned) const;
        GLfloat px2iso_y(unsigned) const;
        unsigned iso2px_x(GLfloat) const;
        unsigned iso2px_y(GLfloat) const;
};