c++ - GLTest.exe 中的 opengl 错误 : Unhandled exception at 0x0251D09F (ig4dev32. dll):0xC0000005:访问冲突读取位置 0x00000000

标签 c++ opengl

我想要获取opengl版本,代码是:

#include "stdafx.h"
#include <GL/glut.h>

void main(int argc, char** argv)
{
    glutInit(&argc,argv);
    glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
    glutInitWindowPosition(100,100);
    glutInitWindowSize(400,300);
    glutCreateWindow("OpenGL Version");
    const char* version = (const char*)glGetString(GL_VERSION);
    printf("OpenGL version:%s\n", version);
    glutMainLoop();
}

但我在 glutCreateWindow("OpenGL Version"); 中收到错误,谁能帮助我?

最佳答案

您似乎正在使用 Microsoft 提供的默认图形驱动程序。要使用 OpenGL,您必须安装显卡制造商提供的驱动程序。

关于c++ - GLTest.exe 中的 opengl 错误 : Unhandled exception at 0x0251D09F (ig4dev32. dll):0xC0000005:访问冲突读取位置 0x00000000,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12126341/

相关文章:

c++ - 如何提取视频帧并对其应用 Imaging SDK 过滤器,然后在 Windows Phone 8.1 中将其另存为视频?

c++ - 使用 libdxf 的段错误

c++ - vector 类错误

opengl - 随处开发 OpenGL 应用程序

c++ - OpenGL/GLSL/GLM - 天空盒像第三人称一样旋转

c++ - 如何在 CMake 中从 COMPILE_FLAGS 迁移到 target_compile_options?

c++ - 无法在 OpenGL 上使用不同的 VAO 渲染不同的网格

opengl - glBindImageTexture() 和 glBindTexture() 有什么区别?

opengl - 如何在没有边缘伪影的情况下从深度重建法线?

c++ - Qt 处理文件