Android background FrameBuffer, can't use 2^x height/widht

Started by qw1nz, March 12, 2014, 11:25:37 AM

Previous topic - Next topic

qw1nz

Hello, For my app I can't use 2^x height/widht, because android devices have many different resolution, I need that image fills my display.
For example: my device has resolution 720x1280, I need set background image 720x1280.
How can I do it?

EgonOlsen

Personally, i would scale it anyway. You can't support any possible resolution out there with a special version of your background image. However, if you still want to, have a look at the NPOTTexture class.

qw1nz

I can scale, but if I have resolution 1080x??? - fullhd display, then I need upload 2048x2048 image. but it give me outofmemoryerror

EgonOlsen

You can always upscale. A 2048*2048 texture uses a LOT of memory and is usually too large for almost any device.

qw1nz

Can I use alpha/invisible framebuffer background or world background that I can see any views behind GLSurfaceView?
If Yes, How can I do it?

EgonOlsen

Yes, you can. You just have to setup the gl context in a different way and clear the framebuffer with some alpha value. You might have to blit your background with transparency in addition. Search the forum, you should be able to find some hints that show you how you modify your setup code. People usually do this to put the camera image into the background.