Create SpriteBatch throw IllegalArgumentException

184 views Asked by At

I'm using 2 stages. One for controls bar (buttons), one for the game. The error send from Google Galaxy Nexus - 4.2.2

Here is my code

public BaseScreen(MyGame game) {
    cam = new OrthographicCamera();
    cam.setToOrtho(true, game.getGameWidth(), game.getGameHeight());
    camera = new PerspectiveCamera();
    viewport = new FitViewport(gameWidth, gameHeight, camera);

    shapeRenderer = new ShapeRenderer();
    shapeRenderer.setProjectionMatrix(cam.combined);
    batcher = new SpriteBatch();
    batcher.setProjectionMatrix(cam.combined);
}

and log:

STACK_TRACE=java.lang.IllegalArgumentException: Error compiling shader: Vertex shader(s) failed to link, fragment shader(s) failed to link.
ERROR: error(#275) Symbol 'v_texCoords' is defined with 2 different types between two stages
ERROR: error(#275) Symbol 'v_texCoords' is defined with 2 different types between two stages
at com.badlogic.gdx.graphics.g2d.SpriteBatch.createDefaultShader(SpriteBatch.java:158)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:121)
at com.badlogic.gdx.graphics.g2d.SpriteBatch.<init>(SpriteBatch.java:74)
at c.j.a.<init>(BaseScreen.java:118)
at c.j.e.<init>(GameScreen.java:11)
at c.a.a(GOGGame.java:270)
at c.j.b.render(CardLobbyLoadingScreen.java:130)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:422)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
0

There are 0 answers