7 if (glfwInit() == GLFW_FALSE) {
8 throw std::runtime_error(
"Failed to initialize GLFW");
11 glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
12 glfwWindowHint(GLFW_RESIZABLE, GLFW_TRUE);
14 GLFWwindow *window = glfwCreateWindow(
static_cast<int>(width),
static_cast<int>(height), title.c_str(),
nullptr,
nullptr);
15 if (window ==
nullptr) {
17 throw std::runtime_error(
"Failed to create window");
19 glfwSetWindowUserPointer(window,
this);