0

请帮帮我。什么时候出错?

主类应用

public class MyGdxGame implements ApplicationListener {

    private Menu GameMenu;
    private SupperUnit TestUnit;
    private Camera camera;

@Override
public void create() {      

            camera = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());

            // inicilized menu
            //GameMenu = new Menu();*/
            TestUnit = new SupperUnit();
}

@Override
public void dispose() {

            TestUnit.Dispose();
}

@Override
public void render() {      
    Gdx.gl.glClearColor(0.5f , 1, 1, 1);
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
            camera.update();

            TestUnit.Draw();
}

@Override
public void resize(int width, int height) {
}

@Override
public void pause() {
}

@Override
public void resume() {
}

}

超级单位类

public class SupperUnit {
    // graphic variables
    private Texture uTexture;
    private Material uMaterial;
    private StillModel Model;
    private Color uColor;


    // ctors
    public SupperUnit() {

        uTexture = new Texture(Gdx.files.internal("data/libgdx.png"));
        uMaterial = new Material();
        uMaterial.addAttribute(new TextureAttribute(uTexture, 0, TextureAttribute.diffuseTexture));

        ObjLoader obLoader = new ObjLoader();
        Model = obLoader.loadObj(Gdx.files.internal( "data/simple.obj" ) );
        Model.setMaterial(uMaterial);

    }



    public void Draw(){

       Model.render();

    }

     public void Dispose(){ // delete resource

        Model.dispose();
    }
}

当我评论线 Model.render(); 在 Draw() 函数中运行程序,否则不运行程序。

使用 Java,libgdx 版本 0.9.8,android sdk。android ver 4.0.4 的应用程序错误:I am_crash: [7249,com.AndroidKvaGame,33862,java.lang.IllegalStateException,can't use this render method with OpenGL ES 2.0,Mesh.java,455]

感谢您提供任何信息

4

0 回答 0