视频驱动程序不支持OpenGL [英] OpenGL is not supported by the video driver
本文介绍了视频驱动程序不支持OpenGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用此代码时:
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "MtxJungleGameMenu";
cfg.useGL20 = false;
cfg.width = 800;
cfg.height = 480;
new LwjglApplication(new MainStarter(), cfg);
}
}
我遇到这样的异常:
线程"LWJGL应用程序"中的异常com.badlogic.gdx.utils.GdxRuntimeException:com.badlogic.gdx.utils.GdxRuntimeException:视频驱动程序不支持OpenGL.
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.
有什么帮助吗?
推荐答案
输入此代码 System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL","true");
Put this code System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true");
我的问题已解决..这将使libgdx以软件openGL模式运行.
Problem solved in my case.. this will allow libgdx to run as software openGL mode.
您的代码将如下所示.
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
public class Main {
public static void main(String[] args) {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true");
cfg.title = "MtxJungleGameMenu";
cfg.useGL20 = false;
cfg.width = 800;
cfg.height = 480;
new LwjglApplication(new MainStarter(), cfg);
}
}
这篇关于视频驱动程序不支持OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文