libgdx-html5:texture dispose生成bufferunderflowexception
我正在用ANDROID上的LIBGDX开发游戏。今天,我尝试在HTML5版本中生成我的一个项目。我将WAR文件夹的内容放在服务器上。除了两件事,一切都好。我将在这里介绍这两个问题中的一个 问题是:当必须处理纹理时(通过调用其方法dispose()),我会得到一个BufferUnderflowException。每次都是这样 以下是创建新项目时自动生成的示例代码:libgdx-html5:texture dispose生成bufferunderflowexception,html,textures,libgdx,dispose,bufferunderflowexception,Html,Textures,Libgdx,Dispose,Bufferunderflowexception,我正在用ANDROID上的LIBGDX开发游戏。今天,我尝试在HTML5版本中生成我的一个项目。我将WAR文件夹的内容放在服务器上。除了两件事,一切都好。我将在这里介绍这两个问题中的一个 问题是:当必须处理纹理时(通过调用其方法dispose()),我会得到一个BufferUnderflowException。每次都是这样 以下是创建新项目时自动生成的示例代码: public class TexDispose implements ApplicationListener { privat
public class TexDispose implements ApplicationListener
{
private OrthographicCamera camera;
private SpriteBatch batch;
private Texture texture;
@Override
public void create() {
float w = Gdx.graphics.getWidth();
float h = Gdx.graphics.getHeight();
camera = new OrthographicCamera(1, h/w);
batch = new SpriteBatch();
texture = new Texture(Gdx.files.internal("data/libgdx.png"));
Gdx.input.setInputProcessor(this);
}
@Override
public void dispose() {
batch.dispose();
texture.dispose(); // HERE IS THE ERROR
}
@Override
public void render() {
Gdx.gl.glClearColor(1, 1, 1, 1);
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
batch.setProjectionMatrix(camera.combined);
batch.begin();
batch.end();
}
@Override
public void resize(int width, int height) {
}
}
你们中有人遇到过这个问题吗。。?如果是,我怎样才能避免(除了不处理任何lol)
谢谢!;) 您可以包含来自异常的回溯吗?