简体   繁体   English

LWJGL像素格式在导出后未加速,但在导出前未加速(包括库和本机)

[英]LWJGL Pixel format not accelerated after export but not before (Libs and Natives included)

So after exporting my LWJGL game I get the following error. 因此,导出我的LWJGL游戏后,出现以下错误。

Fri Oct 02 20:40:01 AEST 2015 INFO: LWJGL Version: 8.15.10.2900
Fri Oct 02 20:40:01 AEST 2015 INFO: Width: 1024
Fri Oct 02 20:40:01 AEST 2015 INFO: Width: 576
Failed to create Display.
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:252)
        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.lwjgl.opengl.Display.create(Display.java:739)
        at com.base.engine.rendering.Window.CreateWindow(Window.java:36)
        at com.base.engine.core.CoreEngine.CreateWindow(CoreEngine.java:27)
        at com.base.game.Main.main(Main.java:8)
Exception in thread "main" java.lang.RuntimeException: No OpenGL context found in the current thread.
        at org.lwjgl.opengl.GLContext.getCapabilities(GLContext.java:124)
        at org.lwjgl.opengl.GL20.glCreateProgram(GL20.java:253)
        at com.base.engine.rendering.resourceManagement.ShaderResource.<init>(ShaderResource.java:35)
        at com.base.engine.rendering.Shader.<init>(Shader.java:55)
        at com.base.engine.rendering.RenderingEngine.<init>(RenderingEngine.java:52)
        at com.base.engine.core.CoreEngine.CreateWindow(CoreEngine.java:28)
        at com.base.game.Main.main(Main.java:8)

Yet I don't get it in Eclipse. 但是我没有在Eclipse中得到它。 I've included the native and libs. 我已经包括了本地和库。

I'm currently using this from the Command Prompt to start the game. 我目前正在使用命令提示符中的代码来启动游戏。

java -Djava.library.path=(natives location) -jar game.jar 1024 576 60

Alright I've worked out the problem. 好吧,我已经解决了这个问题。 LWJGL doesn't seem to work in java 8. My eclipse workspace was configured to use Java 7 so it launched. LWJGL在Java 8中似乎不起作用。我的Eclipse工作区已配置为使用Java 7,因此它启动了。

I ended up using 我最终使用

@echo off
"C:\Program Files\Java\jdk1.7.0_79\bin\java.exe" %*

and saving it as java7.bat then I used the word java7 instead of java and it worked. 并将其保存为java7.bat,然后我使用单词java7而不是java来工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM