如何测试运行jMonkey?

时间:2012-06-27 07:27:45

标签: jmonkeyengine

我正在尝试基本的jMonkey,但我得到了这个异常

jun 27, 2012 9:25:08 FM com.jme3.system.JmeDesktopSystem initialize
Info: Running on jMonkeyEngine 3.0.0 Beta
jun 27, 2012 9:25:08 FM com.jme3.system.Natives extractNativeLibs
Info: Extraction Directory: C:\prv_workspace_8\DungeonWorldAdventure
jun 27, 2012 9:25:13 FM com.jme3.system.lwjgl.LwjglAbstractDisplay run
Info: Using LWJGL 2.8.3
jun 27, 2012 9:25:13 FM com.jme3.system.lwjgl.LwjglDisplay createContext
Info: Selected display mode: 640 x 480 x 0 @0Hz
jun 27, 2012 9:25:13 FM com.jme3.app.Application handleError
Allvarlig: 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:214)
    at org.lwjgl.opengl.Display.createWindow(Display.java:306)
    at org.lwjgl.opengl.Display.create(Display.java:873)
    at org.lwjgl.opengl.Display.create(Display.java:782)
    at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:137)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:113)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
    at java.lang.Thread.run(Thread.java:722)

jun 27, 2012 9:25:13 FM com.jme3.app.Application handleError
Allvarlig: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalStateException
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:147)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)
    at java.lang.Thread.run(Thread.java:722)


Exception: java.lang.NullPointerException thrown from the UncaughtExceptionHandler in thread "LWJGL Renderer Thread"

我正在尝试运行的代码是

package adventure;

import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.math.ColorRGBA;

/** Sample 1 - how to get started with the most simple JME 3 application.
 * Display a blue 3D cube and view from all sides by
 * moving the mouse and pressing the WASD keys. */
public class Test extends SimpleApplication {

    public static void main(String[] args){
        Test app = new Test();
        app.start(); // start the game
    }

    @Override
    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1); // create cube shape at the origin
        Geometry geom = new Geometry("Box", b);  // create cube geometry from the shape
        Material mat = new Material(assetManager,
          "Common/MatDefs/Misc/Unshaded.j3md");  // create a simple material
        mat.setColor("Color", ColorRGBA.Blue);   // set color of material to blue
        geom.setMaterial(mat);                   // set the cube's material
        rootNode.attachChild(geom);              // make the cube appear in the scene
    }
}

我做错了什么?

1 个答案:

答案 0 :(得分:1)

这看起来像显卡驱动程序问题。确保更新您的驱动程序。如果这不起作用,你的显卡可能已经过时了。