Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - livingcode

Pages: [1]
1
Support / Strange behaviour with static Texture background
« on: December 18, 2010, 05:42:32 pm »
Hello!
I want to make a static background (from picture) and to show a simple cube infront of it. I have modified the Hello World example - instead of using color for background, I used 512*512 big Texture. But when I rotate cube, something strange happens:

(when I load it and don't touch it)




(the more I touch/rotate it, the more it fades!)

Code modifications:
I load my texture into TextureManager from onCreate()
Code: [Select]
TextureManager.getInstance().addTexture("textureBG", new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.garden)), 512, 512)));

And then in the onDrawFrame(GL10 gl)
Code: [Select]
fb.blit(TextureManager.getInstance().getTexture("textureBG"), 512, 512, 0, 0, 512, 512, false);
world.renderScene(fb);
world.draw(fb);
fb.display();

What am I doing wrong? How can I fix it?
Thank You!

Pages: [1]