Lightweight OpenGL 3D Renderer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Euclid/headers/window.hpp

39 lines
930 B

#pragma once
2 years ago
#include <glad/glad.h>
#include "GLFW/glfw3.h"
2 years ago
#include <map>
// Default window dimensions
#define D_WINDOW_TITLE "Euclid Engine"
2 years ago
2 years ago
#define D_WINDOW_WIDTH 640
#define D_WINDOW_HEIGHT 480
class Window {
public:
Window(const char* title);
Window(const char* title, unsigned int w, unsigned int h);
2 years ago
~Window();
void spawn();
2 years ago
unsigned int getWidth() { return _width; } // getters and dumb and
unsigned int getHeight() { return _height; } // cpp should have readonly fields...
GLFWwindow* getWindow() { return _win; }
2 years ago
void updateSize(int w, int h);
2 years ago
void makeCurrent();
void swapBuffers();
private:
2 years ago
GLFWwindow* _win;
static std::map<GLFWwindow*, Window*> windowMap;
const char* _title = D_WINDOW_TITLE;
unsigned int _width = D_WINDOW_WIDTH;
unsigned int _height = D_WINDOW_HEIGHT;
void setWidth(unsigned int w) { _width = w; }
void setHeight(unsigned int h) { _height = h; }
};