我正在尝试使用 64 位 JDK 8u60 在 LWJGL 和 Slick2D 中编译程序。但是,当我不把本地人放进去时,它说它缺少 lwjgl64。导入 lwjgl64.dll 本机后,会出现运行时错误,指出我的像素格式未加速。我读过其他资料,有人说我需要安装更新的驱动程序。但是,我已经检查了新的更新并且没有任何更新。使用 32 位 JDK 8u60 时不会出现运行时错误,也无需指定 native。有人可以帮我解决这个问题吗?我宁愿不必安装 JDK 8u60 32 位安装而不是 64 位。
这是我的代码
package dungeon.main;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
public class Main extends BasicGame {
private static int width = 1200;
private static int height = 800;
private static boolean fullscreen = false;
private static int targetFramerate = 120;
private static boolean showFramerate = true;
public static void main(String[] args) {
try {
AppGameContainer appGameContainer = new AppGameContainer(new Main("Dungeon"));
appGameContainer.setDisplayMode(width, height, fullscreen);
appGameContainer.setTargetFrameRate(targetFramerate);
appGameContainer.setShowFPS(showFramerate);
appGameContainer.start();
} catch (SlickException e) {
e.printStackTrace();
}
}
public Main(String title) {
super(title);
// TODO Auto-generated constructor stub
}
@Override
public void init(GameContainer arg0) throws SlickException {
// TODO Auto-generated method stub
}
@Override
public void update(GameContainer arg0, int arg1) throws SlickException {
// TODO Auto-generated method stub
}
@Override
public void render(GameContainer arg0, Graphics arg1) throws SlickException {
// TODO Auto-generated method stub
}
}
这是错误
Tue Oct 06 09:03:57 EDT 2015 INFO:Slick Build #237
Tue Oct 06 09:03:57 EDT 2015 INFO:LWJGL Version: 2.9.2
Tue Oct 06 09:03:57 EDT 2015 INFO:OriginalDisplayMode: 1600 x 900 x 32 @60Hz
Tue Oct 06 09:03:57 EDT 2015 INFO:TargetDisplayMode: 1200 x 800 x 0 @0Hz
Tue Oct 06 09:03:57 EDT 2015 ERROR:Pixel format not accelerated
org.lwjgl.LWJGLException: Pixel format not accelerated
at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.java:52)
at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:253)
at org.lwjgl.opengl.Display.createWindow(Display.java:306)
at org.lwjgl.opengl.Display.create(Display.java:848)
at org.lwjgl.opengl.Display.create(Display.java:757)
at org.newdawn.slick.AppGameContainer.tryCreateDisplay(AppGameContainer.java:302)
at org.newdawn.slick.AppGameContainer.access$000(AppGameContainer.java:34)
at org.newdawn.slick.AppGameContainer$2.run(AppGameContainer.java:367)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:348)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:317)
at dungeon.main.Main.main(Main.java:21)
org.newdawn.slick.SlickException: Failed to initialise the LWJGL display
at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:378)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:317)
at dungeon.main.Main.main(Main.java:21)