Skip to content

Commit 33b757b

Browse files
committed
Add Error messge when glfwInit/glfwCreateWindow fail. Fixes #102
1 parent fe94133 commit 33b757b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Cpp/1-getting-started/1-1-1-HelloWindow/Application.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <GLFW/glfw3.h>
44

5+
#include <iostream>
6+
57
Application::Application(const std::string& title)
68
{
79
_title = title;
@@ -42,6 +44,7 @@ bool Application::Initialize()
4244
{
4345
if (!glfwInit())
4446
{
47+
std::cout << "GLFW: Failed to initialize\n";
4548
return false;
4649
}
4750

@@ -60,6 +63,7 @@ bool Application::Initialize()
6063
nullptr);
6164
if (_window == nullptr)
6265
{
66+
std::cout << "GLFW: Failed to create a window\n";
6367
Cleanup();
6468
return false;
6569
}

src/Cpp/Framework/Application.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bool Application::Initialize()
1818
{
1919
if (!glfwInit())
2020
{
21-
std::cout << "GLFW: Failed to initialize GLFW\n";
21+
std::cout << "GLFW: Failed to initialize\n";
2222
return false;
2323
}
2424

0 commit comments

Comments
 (0)