Lerchmo
Lerchmo

Reputation: 199

How can I load multiple textures in Opengl es 2.x (in android with libgdx)

Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0);
texture.bind();

I am able to bind 1 texture like this... But if I cant figure out how to bind more textures.

Upvotes: 1

Views: 2450

Answers (1)

Kazuki Sakamoto
Kazuki Sakamoto

Reputation: 14009

Use glActiveTexture(GL20.GL_TEXTURE1) and bind.

tests/gdx-tests/src/com/badlogic/gdx/tests/ShaderMultitextureTest.java

Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE1);
texture2.bind();

Upvotes: 2

Related Questions