BMC Engine v1.0.0
An open-source game engine powered by C and C++
Loading...
Searching...
No Matches
Window.h
1#ifndef WINDOW_H
2#define WINDOW_H
3
4#include "stb_image.h"
5
6#include "glad/glad.h"
7#include "GLFW/glfw3.h"
8
9#include <iostream>
10
11#include "math/Vector.h"
12
13#include "imgui.h"
14#include "imgui_impl_glfw.h"
15#include "imgui_impl_opengl3.h"
16
17#include "errors/ErrorHandler.h"
18
23class Window {
24public:
31 Window(const char* title, int width, int height); // title with size
32
38 Window(const char* title, Vector2 size); // ditto
39
44 Window(const char* title);
45
49 ~Window();
50
54 bool shouldClose();
55
60 void setIcon(const char* file);
61
67 void setSize(int width, int height);
68
73 void setSize(Vector2 size);
74
78 void initImGui();
79
83 void close();
84
88 void maximize();
89
93 int getWidth();
94
98 int getHeight();
99
103 Vector2* getSize();
104
108 GLFWwindow* getWindow();
109
110private:
111 bool _create(const char* title, int width, int height);
112 void _setSize(int width, int height);
113 void _calcViewport(int width, int height);
114 static void _framebuffer_size_callback(GLFWwindow* window, int width, int height);
115
116 GLFWwindow* window;
117};
118
119#endif // WINDOW_H
Definition Vector.h:7
Definition Window.h:23
int getHeight()
Definition Window.cpp:81
GLFWwindow * getWindow()
Definition Window.cpp:93
void setSize(int width, int height)
Definition Window.cpp:43
~Window()
Definition Window.cpp:20
int getWidth()
Definition Window.cpp:74
Window(const char *title, int width, int height)
Definition Window.cpp:5
void close()
Definition Window.cpp:64
void maximize()
Definition Window.cpp:69
void initImGui()
Definition Window.cpp:53
Vector2 * getSize()
Definition Window.cpp:88
void setIcon(const char *file)
Definition Window.cpp:31
bool shouldClose()
Definition Window.cpp:26