Beginning writing gui and window wrapper for GLFW

This commit is contained in:
Pcornat 2022-01-08 21:57:17 +01:00
parent 10cb797084
commit 9dfe0faa56
Signed by: Pcornat
GPG key ID: 2F3932FF46D9ECA0
8 changed files with 141 additions and 4 deletions

13
src/window.cpp Normal file
View file

@ -0,0 +1,13 @@
#include <stdexcept>
#include "window.hpp"
gui::Window::Window() {
glfwSetErrorCallback(nullptr);
if (glfwInit() == GLFW_FALSE) {
throw std::runtime_error("GLFW init failed.");
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
wwindow = std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)>(glfwCreateWindow(600, 800, "Billy Sheet tracker", nullptr, nullptr),
delete_glfw_window);
}