无法在Linux Minut中运行简单的OpenGL程序
Not able to run simple OpenGL program in Linux Minut
我正在Mac上学习OpenGL,它可以正常工作,并且我正在尝试在Linux Mint 17.3上重新创建我的程序17.3在VirtualBox虚拟机中。
我被告知我只需要g ,make,freeglut3-dev和文本编辑器,我相信我已经拥有了所有这些。例如,如果我做sudo apt-get install g++
,它将说g++ is already the newest version
,其余的也一样。
我写了一个简单的程序:
#include <GL/freeglut.h>
#include <GL/gl.h>
void renderFunction() {
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glBegin(GL_POLYGON);
glVertex2f(-0.5, -0.5);
glVertex2f(-0.5, 0.5);
glVertex2f(0.5, 0.5);
glVertex2f(0.5, -0.5);
glEnd();
glFlush();
}
int main(int argc, char** argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(500,500);
glutInitWindowPosition(100,100);
glutCreateWindow("OpenGL - First window demo");
glutDisplayFunc(renderFunction);
glutMainLoop();
return 0;
}
编译命令g++ opengl.c -lglut -lGL -lGLEW -lGLU -o opengl
似乎有效。但是当我运行./opengl
时,我会收到一条大量错误消息:
pci id for fd 4: 80ee:beef, driver (null)
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
OpenGL Warning: glCombinerParameterivNV not found in mesa table
OpenGL Warning: glFinalCombinerInputNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glDeleteFencesNV not found in mesa table
OpenGL Warning: glFinishFenceNV not found in mesa table
OpenGL Warning: glGenFencesNV not found in mesa table
OpenGL Warning: glGetFenceivNV not found in mesa table
OpenGL Warning: glIsFenceNV not found in mesa table
OpenGL Warning: glSetFenceNV not found in mesa table
OpenGL Warning: glTestFenceNV not found in mesa table
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000023ace70
OpenGL Warning: Retry with 0x8002 returned 0 visuals
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000023b2810
OpenGL Warning: Retry with 0x8003 returned 0 visuals
...
OpenGL Warning: XGetVisualInfo returned 0 visuals for 00000000023b1520
OpenGL Warning: Retry with 0x8003 returned 0 visuals
freeglut (./opengl): ERROR: Internal error <visualInfo could not be retrieved from FBConfig> in function fgOpenWindow
我不知道这意味着什么或如何处理。
OpenGL依赖图形驱动程序。VirtualBox没有最新的工作驱动程序。最好的方法就是安装访客添加。Freeglut
也没有帮助,最有前途的是仅使用glad
和GLFW
手动编写最小代码。但是不要期望太多,也不要"测试我的程序的可移植性"。
我曾经设法在尝试几次尝试后与一些实验性台面驱动程序一起在特定版本的Ubuntu上工作,但我不知道如何可靠地重现这一点。在Askubuntu上几乎相同的问题。
相关文章:
- Opengl问题:很可能是简单的纹理问题
- OpenGL C++(制作简单窗口时抛出错误)
- OpenGL GLFW 简单立方体不渲染
- 简单的openGL画线程序没有输出
- 无法在Linux Minut中运行简单的OpenGL程序
- 使用 C# 获取 OpenGL 版本的最简单方法
- gl_invalid_operation错误1218(0x0502)使用简单的OpenGl命令GlverTex2i,gl
- OpenGL - 简单3D游戏的低FPS
- 在OpenGL中移动一个简单的形状(形状在数据结构中)
- XCode 4.5简单的OpenGL C 代码问题
- Opengl 创建一个 3D 框而不是一个简单的三角形
- 用c++和OpenGL创建一个带有简单控件的简单窗口
- C++OpenGL从文件中绘制简单OBJ
- OpenGL 行星生成 - 简单矩阵问题(带鼠标的行星"Spins")
- OpenGL中的简单三角形
- 将简单网格加载到 OpenGL 中时遇到问题
- 编译简单的静态OpenGL 4.0程序,使用MinGW,freeglut和glew
- 用于简单C++OpenGL程序的制作文件
- 使用Flascc的简单OpenGL着色器演示
- 在wxWidgets的简单openGL显示循环中不完整的场景重绘