Jump to content
  • Advertisement
Sign in to follow this  
Michael Wojcik

Android OpenGL ES 2.0 texturing issue

This topic is 2642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello fellow developers.

I am using the Android mobile platform, with OpenGL ES 2.0.

When I make a texture like so, the textures in my scene draw correctly


//Generate there texture pointer
GLES20.glGenTextures(1, textureHandle, 0);

// parameters - we have to make sure we clamp the textures to the edges!!!
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,GLES20.GL_LINEAR);


However, I want to be able to scroll a texture, and I believe setting the wrap mode to GLES20.GL_REPEAT would make the needed calculation more possible. However, when using code such as below.


//Generate there texture pointer
GLES20.glGenTextures(1, textureHandle, 0);

// parameters - we have to make sure we clamp the textures to the edges!!!
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_REPEAT);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_REPEAT);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,GLES20.GL_LINEAR);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,GLES20.GL_LINEAR);


Every texture is black. The only difference I have made here is the setting of the GLES20.GL_REPEAT parameter name in the call to GLES20.glTexParameteri. This seems really odd. Does anyone have some ideas to share?

I appreciate any help.
Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!