VirtualBox中不能正常使用OpneGL的问题

VirtualBox中不能正常使用OpenGL的问题
摘要由CSDN通过智能技术生成

VirtualBox中不能正常使用OpenGL的问题

问题解决过程

VirtualBox版本:4.3.12
系统类型:Ubuntu 14.04

按照网上常见的教程 Ubuntu 安装OpenGL,安装OpenGL库与实用工具包等,如下:

$ sudo apt-get install build-essential
$ sudo apt-get install libgl1-mesa-dev
$ sudo apt-get install libglu1-mesa-dev
$ sudo apt-get install libglut-dev
$ sudo apt-get install freeglut3-dev

结果运行如下例子:

#include <GL/freeglut.h>



void init(void)

{

    glClearColor(0.0, 0.0, 0.0, 0.0);

    glMatrixMode(GL_PROJECTION);

    glOrtho(-5, 5, -5, 5, 5, 15);

    glMatrixMode(GL_MODELVIEW);

    gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);



    return;

}



void display(void)

{

    glClear(GL_COLOR_BUFFER_BIT);

    glColor3f(1.0, 0, 0);

    glutWireTeapot(3);

    glFlush();



    return;

}



int main(int argc, char *argv[])

{

    glutInit(&argc, argv);

    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);

    glutInitWindowPosition(0, 0);

    glutInitWindowSize(300, 300);

    glutCreateWindow("OpenGL 3D View");

    init();

    glutDisplayFunc(display);

    glutMainLoop();



    return 0;

}

g++ opengl_test.cpp -o test -lGL -lGLU -lglut

出现如下类似的错误VirtualBox Ticket #12941

libGL error: 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

Ubuntu下使用OpenGL图像库这篇博客的启发,可能原因是没有安装其它相关的图像用户接口库,运行命令sudo apt-cache search opengl查找与opengl相关的所有库:

compiz - OpenGL window and compositing manager
compiz-core - OpenGL window and compositing manager
compiz-dev - OpenGL window and compositing manager - development files
compiz-gnome - OpenGL window and compositing manager - GNOME window decorator
compiz-plugins-default - OpenGL window and compositing manager - default plugins
freeglut3 - OpenGL Utility Toolkit
freeglut3-dbg - OpenGL Utility Toolkit debugging information
freeglut3-dev - OpenGL Utility Toolkit development files
libcogl-common - Object oriented GL/GLES Abstraction/Utility Layer (common files)
libcogl-dev - Object oriented GL/GLES Abstraction/Utility Layer (development files)
libcogl-doc - Object oriented GL/GLES Abstraction/Utility Layer (documentation)
libcogl-gles2-15 - Object oriented GL/GLES Abstraction/Utility Layer
libcogl-gles2-dev - Object oriented GL/GLES Abstraction/Utility Layer (development files)
libcogl-pango-dev - Object oriented GL/GLES Abstraction/Utility Layer (development files)
libcogl-pango15 - Object oriented GL/GLES Abstraction/Utility Layer
libcogl-pango15-dbg - Object oriented GL/GLES Abstraction/Utility Layer (debug files)
libcogl15 - Object oriented GL/GLES Abstraction/Utility Layer
libcogl15-dbg - Object oriented GL/GLES Abstraction/Utility Layer (debug files)
libdrm-dev - Userspace interface to kernel DRM services -- development files
libdrm2 - Userspace interface to kernel DRM services -- runtime
libdrm2-dbg - Userspace interface to kernel DRM services -- debugging symbols
libegl1-mesa - free implementation of the EGL API -- runtime
libegl1-mesa-dbg - free implementation of the EGL API -- debugging symbols
libegl1-mesa-dev - free implementation of the EGL API -- development files
libegl1-mesa-drivers - free implementation of the EGL API -- hardware drivers
libegl1-mesa-drivers-dbg - free implementation of the EGL API -- driver debugging symbols
libgl1-mesa-dev - free implementation of the OpenGL API -- GLX development files
libgl1-mesa-dri - free implementation of the OpenGL API -- DRI modules
libgl1-mesa-dri-dbg - Debugging symbols for the Mesa DRI modules
libgl1-mesa-glx - free implementation of the OpenGL API -- GLX runtime
libglamor-dev - shared graphics acceleration library based on OpenGL -- development files
libglamor0 - shared graphics acceleration library based on OpenGL
libgles1-mesa - free implementation of the OpenGL|ES 1.x API -- runtime
libgles1-mesa-dbg - free implementation of the OpenGL|ES 1.x API -- debugging symbols
libgles1-mesa-dev - free implementation of the OpenGL|ES 1.x API -- development files
libgles2-mesa - free implementation of the OpenGL|ES 2.x API -- runtime
libgles2-mesa-dbg - free implementation of the OpenGL|ES 2.x API -- debugging symbols
libgles2-mesa-dev - free implementation of the OpenGL|ES 2.x API -- development files
libglew-dbg - OpenGL Extension Wrangler (debugging symbols)
libglew-dev - OpenGL Extension Wrangler - development environment
libglew1.10 - OpenGL Extension Wrangler - runtime environment
libglewmx-dbg - OpenGL Extension Wrangler MX (debugging symbols)
libglewmx-dev - OpenGL Extension Wrangler MX - development environment
libglewmx1.10 - OpenGL Extension Wrangler (Multiple Rendering Contexts)
libglm-dev - C++ library for OpenGL GLSL type-based mathematics
libglm-doc - documentation for the OpenGL Mathematics (GLM) library
libglu1-mesa - Mesa OpenGL utility library (GLU)
libglu1-mesa-dev - Mesa OpenGL utility library -- development files
libnux-4.0-0 - Visual rendering toolkit for real-time applications - shared lib
libnux-4.0-common - Visual rendering toolkit for real-time applications - common files
libnux-4.0-dev - Visual rendering toolkit for real-time applications - dev files
libosmesa6 - Mesa Off-screen rendering extension
libqt4-opengl - Qt 4 OpenGL module
libqt4-opengl-dev - Qt 4 OpenGL library development files
libqt5opengl5 - Qt 5 OpenGL module
libqt5opengl5-dev - Qt 5 OpenGL library development files
libqt5qml-graphicaleffects - Qt 5 Graphical Effects module
libqtopengl4-perl - perl bindings for the Qt OpenGL library
libreoffice-ogltrans - LibreOffice Impress extension for transitions using OpenGL
libsmokeqtopengl4-3 - Qt OpenGL SMOKE library
libtiff-tools - TIFF manipulation and conversion tools
libtxc-dxtn-s2tc0 - Texture compression library for Mesa
mesa-common-dev - Developer documentation for Mesa
nux-tools - Visual rendering toolkit f
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值