opengl win32程序建立
最近开始学习opengl。opengl win32下有很多框架可以用,它们的基本原理大至是对win32窗口程序的封装,和opengl初始化的一些封装。看了下,最终选定glfw。
第一个程序如下:
#include <glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(480, 320, "Hello World", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (!glfwWindowShould