#include <GLFW/glfw3.h>
#ifdef _WIN32
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glfw3.lib")
#endif //
const int WIDTH = 640;
const int HEIGHT = 480;
int main(int argc, char** argv){
glfwInit();
GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "OGL_APP1", NULL, NULL);
if (window == nullptr){
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while (!glfwWindowShouldClose(window)){
glClearColor(0, 0, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
return 0;
}
网友评论