Skip to content

Commit 9df7e73

Browse files
Update Window.cpp
1 parent b86b948 commit 9df7e73

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Window.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ bool Window::Initialize(const std::string& title, int width, int height) {
1919
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
2020
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
2121
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
22+
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
23+
glfwWindowHint(GLFW_DECORATED, GLFW_TRUE);
24+
glfwWindowHint(GLFW_FOCUSED, GLFW_TRUE);
2225

2326
m_Window = glfwCreateWindow(width, height, title.c_str(), nullptr, nullptr);
2427
if (!m_Window) {
@@ -27,11 +30,20 @@ bool Window::Initialize(const std::string& title, int width, int height) {
2730
}
2831

2932
glfwMakeContextCurrent(m_Window);
33+
glfwSwapInterval(1);
34+
35+
glfwSetErrorCallback([](int error, const char* description) {
36+
fprintf(stderr, "GLFW Error %d: %s\n", error, description);
37+
});
38+
3039
return true;
3140
}
3241

3342
void Window::Update() {
3443
glfwPollEvents();
44+
}
45+
46+
void Window::SwapBuffers() {
3547
glfwSwapBuffers(m_Window);
3648
}
3749

0 commit comments

Comments
 (0)