Author Topic: Android background FrameBuffer, can't use 2^x height/widht  (Read 935 times)

Offline qw1nz

  • byte
  • *
  • Posts: 3
    • View Profile
Android background FrameBuffer, can't use 2^x height/widht
« on: March 12, 2014, 11:25:37 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12011
    • View Profile
    • http://www.jpct.net
Re: Android background FrameBuffer, can't use 2^x height/widht
« Reply #1 on: March 12, 2014, 11:29:18 am »
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.

Offline qw1nz

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Android background FrameBuffer, can't use 2^x height/widht
« Reply #2 on: March 12, 2014, 12:01:13 pm »
I can scale, but if I have resolution 1080x??? - fullhd display, then I need upload 2048x2048 image. but it give me outofmemoryerror

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12011
    • View Profile
    • http://www.jpct.net
Re: Android background FrameBuffer, can't use 2^x height/widht
« Reply #3 on: March 12, 2014, 02:23:59 pm »
You can always upscale. A 2048*2048 texture uses a LOT of memory and is usually too large for almost any device.

Offline qw1nz

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Android background FrameBuffer, can't use 2^x height/widht
« Reply #4 on: March 13, 2014, 03:48:20 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12011
    • View Profile
    • http://www.jpct.net
Re: Android background FrameBuffer, can't use 2^x height/widht
« Reply #5 on: March 13, 2014, 10:08:57 am »
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.