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; }