LibGdx returns NULL for a gl object using GL10
I am developing a game using LibGdx, when i tried to run the game in motorola atrix which is of 2.2.2 version, it is not accepting GL10 and giving null for gl object. Can anyone help me on this.
Code below:
开发者_如何学编程public class Game2D implements InputProcessor, ApplicationListener {
public void create() {
//initializing all
}
public void render() {
GL10 gl = Gdx.graphics.getGL10();
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
Gdx.graphics.getGL10().glViewport(
0,
0,
Gdx.graphics.getWidth(),
Gdx.graphics.getHeight()
);
camera.update();
camera.apply(gl);
//-------------------
}
}
It's hard to say without seeing a code snippet, but I feel like you're using GL related stuff before the context is initialized.
精彩评论