程序的环境搭建下面的内容说的很详细:
https : //blog.csdn.net/Leo_LiangXuYuan/article/details/82957828
补充:
修改窗口,要修改成 窗口 (/SUBSYSTEM:WINDOWS)
编译的时候要选择win32
开局的第一个程序顺利跑起来了,不过还是不太明白为啥作者要用这个方式去讲解openGL,为啥不直接调用库,反而要自己写个库,这样的话程序岂不是还有研究源代码吗。
#include "sb7.h"
// Derive my_application from sb7::application
class my_application : public sb7::application
{
public:
// Our rendering function
void render(double currentTime)
{
// Simply clear the window with red
static const GLfloat red[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glClearBufferfv(GL_COLOR, 0, red);
}
};
// Our one and only instance of DECLARE_MAIN
DECLARE_MAIN(my_application);