open window
This commit is contained in:
parent
5824ba82f0
commit
a7cf1763b2
1 changed files with 16 additions and 2 deletions
18
src/main.cpp
18
src/main.cpp
|
@ -1,6 +1,10 @@
|
|||
#include <glad/glad.h>
|
||||
#include <glad/glad.h> // must come before GLFW
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <thread>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue