1
我正在嘗試使用64位JDK 8u60編譯LWJGL和Slick2D中的程序。但是,當我不把土着當成它說它缺少lwjgl64。導入lwjgl64.dll原生文件後,會出現運行時錯誤,指出我的像素格式未加速。我已閱讀其他來源,並且有人說我需要安裝較新的驅動程序。但是,我檢查了新的更新並沒有任何更新。使用32位JDK 8u60時,不會出現運行時錯誤,也不需要指定本機。有人可以幫我解決這個問題嗎?我寧願不必安裝JDK 8u60 32位安裝而不是64位。LWJGL&Slick2D 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)
我想你的輸入法設置的代碼當地人,但這並沒有在相同的錯誤之前的工作和結果。軟件渲染確實奏效,但不幸的是,這不是我正在尋找的。我需要使用64位JDK的硬件渲染 – JavaFreak
我使用的是64位JDK 7,一切正常。用java 7.再次檢查它。如果你一直得到這個問題,它將與本地庫有關 – Unlox
這裏lwjgl土着對我來說很漂亮http://www.speedyshare.com/s9NWR/native.zip – Unlox