java 视频驱动程序不支持 OpenGL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15572908/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 20:06:49  来源:igfitidea点击:

OpenGL is not supported by the video driver

javalibgdx

提问by Vishal Singh

When I use this code:

当我使用此代码时:

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);
   }
}

I get an exception like this:

我得到这样的异常:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.GdxRuntimeException: OpenGL is not supported by the video driver.

线程“LWJGL 应用程序”中的异常 com.badlogic.gdx.utils.GdxRuntimeException:com.badlogic.gdx.utils.GdxRuntimeException:视频驱动程序不支持 OpenGL。

any help?

有什么帮助吗?

回答by Paresh Dudhat

Put this code System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true");

把这段代码 System.setProperty("org.lwjgl.opengl.Display.allowSoftwareOpenGL", "true");

Problem solved in my case.. this will allow libgdx to run as software openGL mode.

问题在我的情况下解决了..这将允许 libgdx 作为软件 openGL 模式运行。

Your code will look like this.

您的代码将如下所示。

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);
   }
}

回答by Kumar Saurabh

You need to update your video drivers.

您需要更新视频驱动程序。

Basically the display drivers for your P.C

基本上是您 PC 的显示驱动程序

回答by Joseph

i had a problem just like it and fixed it by downgrading to jdk 8 update 45.

我遇到了一个类似的问题,并通过降级到jdk 8 update 45来修复它

i was using win 10 along with the integrated Intel HD 2000 for graphics .

我使用的是 win 10 和集成的 Intel HD 2000 显卡。