【发布时间】:2015-03-04 23:40:39
【问题描述】:
所以过去一天我一直在尝试 libgdx,它运行良好,直到我意识到它只适用于我的带有英特尔显卡的笔记本电脑,而它在我的带有 nvidia 750ti 的台式机上立即关闭。
根据this github issue 的说法,这个问题应该已经在this commit 中修复了。
我还尝试了旧帖子中其他人推荐的方法,例如 here 和 here(自那次提交以来不再需要,但值得尝试)
System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true");
不管你信不信,它是行不通的。这是堆栈跟踪
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:229)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:174)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:138)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: org.lwjgl.LWJGLException: X Error - disp: 0x7f0f4c000c50 serial: 194 error: BadValue (integer parameter out of range for operation) request_code: 154 minor_code: 24
at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:320)
at org.lwjgl.opengl.LinuxContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.LinuxContextImplementation.create(LinuxContextImplementation.java:51)
at org.lwjgl.opengl.ContextGL.<init>(ContextGL.java:132)
at org.lwjgl.opengl.Display.create(Display.java:850)
at org.lwjgl.opengl.Display.create(Display.java:757)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.createDisplayPixelFormat(LwjglGraphics.java:220)
... 3 more
将堆栈跟踪与this guy 进行比较时,原因显然不是Pixel format is not accelerated 而是Caused by: org.lwjgl.LWJGLException: X Error - disp: 0x7f12cc000c50 serial: 194 error: BadValue (integer parameter out of range for operation) request_code: 154 minor_code: 24。
也许这只是因为我正在运行 linux 而他不是,我不知道。虽然integer parameter out of range for operation 错误会是 LWJGL 认为我的视频驱动程序不支持 OpenGL 的原因,但这看起来确实很奇怪,但这只是一个猜测。
Here is the exact code that i'm trying to run。我不认为代码应该受到责备,因为它在我的笔记本电脑上运行良好,但我在这里添加了它以防万一。
我的笔记本电脑和台式机都运行最新的 Arch Linux 安装,所以操作系统应该不是问题。
提前致谢!
【问题讨论】:
-
github 问题是因为硬件设备太旧而无法支持 LWJGL。我认为你的情况不同。有任何 OpenGL 应用程序适合您吗? (你能让
glxgears工作吗?) -
谢谢,OpenGL 出了点问题,简单的重启解决了我的问题。当我启动它们时,glxinfo 和 glxgears 就崩溃了。