From a7cf1763b21eafe53ecaefb3d29d2736bb39a4c7 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 13 Oct 2023 00:40:57 +0200 Subject: [PATCH] open window --- src/main.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index bb8b99f..523ba8b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,10 @@ -#include +#include // must come before GLFW + #include +#include #include +#include + int main() { printf("running the main function...\n"); printf("glfw init\n"); @@ -8,7 +12,17 @@ int main() { glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); + printf("opening window\n"); + GLFWwindow *window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL); + if (window == NULL) { + std::cout << "Failed to create GLFW window" << std::endl; + glfwTerminate(); + return -1; + } + glfwMakeContextCurrent(window); + printf("closed window\n"); + + printf("program finished\n"); return 0; }