在头文件opengl中声明所有显示列表
Declaring all display lists in a header file opengl
我的文件结构为
- display_list.hpp
- display_list.cpp
- 文件1.cpp
现在我想使用file1.cpp.中的一个显示列表
我的display_list.hpp
看起来像
extern GLuint index;
void genDisplayList();
则CCD_ 2看起来像
GLuint index = glGenLists(1);
void genDisplayList(){
glNewList(index, GL_COMPILE);
glBegin(GL_POLYGON);
/*..vertex for polygon...*/
glEnd();
glEndList();
}
但当我尝试在file1.cpp中使用glCallList(index)
时,屏幕上什么也没画出来。
a)您不应该使用显示列表。显示列表已被OpenGL-2弃用(OpenGL-2的初稿完全删除了它们),并已从OpenGL-3及更高版本中删除。
b) 要创建显示列表,需要在当前线程上激活有效的OpenGL上下文。我假设您在OpenGL上下文出现之前调用genDisplayLists
,例如,如果它们是由全局作用域对象实例的构造函数调用的。
相关文章:
- 如何告诉 gcc 显示您使用的优化标志列表
- 动态填充的组合框不显示文本,列表未定义
- 程序输入名称和高度并显示它。我不知道如何显示列表中最高人的姓名和身高
- 如何在函数运行时逐个显示列表项
- 使用 Struct 进行 mp3 播放器模拟C++(不需要播放 mp3 的唯一显示列表)
- 如何在 c++ 中显示列表
- OpenGL显示列表比即时模式慢
- 链接列表:在C++中按物理和逻辑顺序显示列表
- OpenGL 显示列表优化
- 正在删除OpenGL中的嵌套显示列表
- 旋转和转换显示列表
- 在头文件opengl中声明所有显示列表
- 显示列表在使用一次时是否比固定模式更好
- 不显示列表中选定的选项
- OpenGL显示列表块glEnable(GL_COLOR_MATERIAL)
- 如何在Repeater内部的UI QML (QT)中显示列表中的值
- 显示列表<矢量<int>>元素
- c++中的类显示列表
- "R6025 - pure virtual call" in 显示列表, OpenGL, C++
- 显示列表无法正常工作