diff --git a/src/main.cpp b/src/main.cpp index bb8b99f..65317cc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,14 @@ -#include +#include // must come before GLFW + #include + +#include #include +#include +#include +#include + + int main() { printf("running the main function...\n"); printf("glfw init\n"); @@ -8,7 +16,20 @@ 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); + + std::this_thread::sleep_for(std::chrono::milliseconds(2000)); + + printf("closed window\n"); + + printf("program finished\n"); return 0; }