-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.cpp
More file actions
34 lines (24 loc) · 730 Bytes
/
Window.cpp
File metadata and controls
34 lines (24 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Window.h"
Window::Window(){
}
Window::Window(int width, int height) : width(width), height(height){
glfwInit();
this->window = glfwCreateWindow(width, height, "standard", nullptr, nullptr);
// glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
//this enables the context. We can use the 'get window context' to keep the engine encapsulated.
//look into this.
glfwMakeContextCurrent(window);
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
}
GLFWwindow* Window::getWindow(){
return this->window;
}
void Window::destroy(){
glfwDestroyWindow(this->window);
}
int Window::getHeight(){
return height;
}
int Window::getWidth(){
return width;
}