Results 1 to 5 of 5
  1. #1
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default JMonkey default game

    When I choose to create project, and select as 'simple game'.
    The default code is generated.

    Java Code:
    package mygame;
    
    import com.jme3.app.SimpleApplication;
    import com.jme3.material.Material;
    import com.jme3.math.ColorRGBA;
    import com.jme3.math.Vector3f;
    import com.jme3.renderer.RenderManager;
    import com.jme3.scene.Geometry;
    import com.jme3.scene.shape.Box;
    
    /**
     * test
     * @author normenhansen
     */
    public class Main extends SimpleApplication {
    
        public static void main(String[] args) {
            Main app = new Main();
            app.start();
        }
    
        @Override
        public void simpleInitApp() {
            Box b = new Box(1, 1, 1);
            Geometry geom = new Geometry("Box", b);
    
            Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
            mat.setColor("Color", ColorRGBA.Blue);
            geom.setMaterial(mat);
    
            rootNode.attachChild(geom);
        }
    
        @Override
        public void simpleUpdate(float tpf) {
            //TODO: add update code
        }
    
        @Override
        public void simpleRender(RenderManager rm) {
            //TODO: add render code
        }
    }
    If I run it, click "continue" ... programs drops error.

    run:
    Jan 11, 2017 12:55:42 PM com.jme3.system.JmeDesktopSystem initialize
    INFO: Running on jMonkeyEngine 3.0.10
    Jan 11, 2017 12:55:42 PM com.jme3.system.Natives extractNativeLibs
    INFO: Extraction Directory: C:\Users\t\Desktop\JMonkey\startivity\Games
    Jan 11, 2017 12:55:42 PM com.jme3.app.Application handleError
    SEVERE: Failed to create display
    org.lwjgl.LWJGLException: Pixel format not accelerated
    at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelForma t(Native Method)
    at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat (WindowsPeerInfo.java:52)
    at org.lwjgl.opengl.WindowsDisplay.createWindow(Windo wsDisplay.java:244)
    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 com.jme3.system.lwjgl.LwjglDisplay.createContext(L wjglDisplay.java:140)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInT hread(LwjglAbstractDisplay.java:113)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(Lwj glAbstractDisplay.java:207)
    at java.lang.Thread.run(Thread.java:744)

    Jan 11, 2017 12:55:42 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run
    SEVERE: Display initialization failed. Cannot continue.

    eroor.bmp

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: JMonkey default game

    Is there a web site for the com.jme3 package? I have not seen any questions here about it.
    Last edited by Norm; 01-11-2017 at 02:38 PM.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    asdfg is offline Member
    Join Date
    Nov 2016
    Posts
    98
    Rep Power
    0

    Default Re: JMonkey default game

    I have downloaded it today. Straight from here. https://github.com/jMonkeyEngine/sdk...ses/tag/stable windows x64
    I have not added packages.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,493
    Rep Power
    29

    Default Re: JMonkey default game

    I have not added packages.
    The packages I am talking about are referenced in the import statements on lines 3 to 9 in the posted code. Those packages are from a third party and are not part of java SE.

    You will find more help on a site that works with those packages.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,130
    Rep Power
    23

    Default Re: JMonkey default game

    Try and update your graphics drivers, for a start.
    That seems to be one cause.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Writing a Pong game - enhancing my default code.
    By DeagleFace in forum New To Java
    Replies: 6
    Last Post: 05-12-2012, 05:30 PM
  2. [help/need] jmonkey project
    By Loffee in forum Java Gaming
    Replies: 1
    Last Post: 03-30-2012, 03:18 AM
  3. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 04:08 PM
  4. Jmonkey engine
    By daanlaan in forum New To Java
    Replies: 0
    Last Post: 07-07-2009, 04:42 PM
  5. Replies: 1
    Last Post: 03-10-2009, 02:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •