我的文件结构为
- 显示列表.hpp
- 显示列表.cpp
- 文件1.cpp
现在我想使用 file1.cpp 中的显示列表之一。
我的display_list.hpp
样子
extern GLuint index;
void genDisplayList();
然后display_list.cpp
看起来像
GLuint index = glGenLists(1);
void genDisplayList(){
glNewList(index, GL_COMPILE);
glBegin(GL_POLYGON);
/*..vertex for polygon...*/
glEnd();
glEndList();
}
但是当我尝试在glCallList(index)
我的 file1.cpp 中使用时,我没有在屏幕上绘制任何内容。