gpt4 book ai didi

c - 来自 OpenGL 的 X11 BadAlloc 错误

转载 作者:太空宇宙 更新时间:2023-11-04 02:17:05 25 4
gpt4 key购买 nike

我正在使用 this book 学习 OpenGL .我正在尝试运行第一个示例,即 here .它编译得很好,但是当我尝试运行它时,出现 X11 BadAlloc 错误:

X Error of failed request:  BadAlloc (insufficient resources for operation)
Major opcode of failed request: 128 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 38
Current serial number in output stream: 39

据我所知,这个错误是在调用 glutCreateWindow 时引起的。我不知道这是 X 本身的问题还是我的显卡问题,它是 nVidia geForce 310。

最佳答案

您的图形驱动程序不支持 OpenGL 4.0 版。

glutInitContextVersion(4, 0);

我把它改成了 3.3:

glutInitContextVersion(3, 3);

而且效果很好。您可以从 glxinfo 获取您的 OpenGL 版本。

关于c - 来自 OpenGL 的 X11 BadAlloc 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6073761/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com