视频驱动程序不支持 OpenGL [英] OpenGL is not supported by the video driver

查看:29
本文介绍了视频驱动程序不支持 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆