-1
我的文件结构宣布所有显示列表头文件的OpenGL
- display_list.hpp
- display_list.cpp
- file1.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,我什么也没得到在屏幕上绘制。
我使用的是opengl 2.0,并且已经正确初始化上下文。 – Dheerendra 2014-10-03 12:35:58