不能创建opengl窗口
Basic step to make any program on OpenGL is created a window where all the code will work so how it we can create it? After installing OpenGL libraries on your machine (OpenGL installation guide for Ubuntu: How to install OpenGL in Ubuntu) we can begin.
在OpenGL上制作任何程序的基本步骤是创建一个窗口,所有代码都将在其中工作,因此我们如何创建它? 在您的机器上安装OpenGL库之后(Ubuntu的OpenGL安装指南: 如何在Ubuntu中安装OpenGL ),我们可以开始了。
Let’s first understand how to structure an OpenGL program?
首先让我们了解如何构建OpenGL程序吗?
Place all initialization and related one-time parameter setting together preferably in functioninit().
最好将所有初始化和相关的一次性参数设置放到functioninit()中 。
Geometric description of the picture that we want to draw (display) in user-defined function which will be referenced in GLUT function, glutDisplayFunc().
我们要在用户定义函数中绘制(显示)的图片的几何描述,这将在GLUT函数glutDisplayFunc()中引用。
main function will contain GLUT function for setting up the display window and getting the image screen.
主要功能将包含GLUT功能,用于设置显示窗口和获取图像屏幕。
Program:
程序:
Let’s get our ha