Author Topic: Background pic  (Read 4000 times)

Offline vael

  • byte
  • *
  • Posts: 10
    • View Profile
Background pic
« on: August 21, 2010, 10:53:35 pm »
Hi all. I've got a problem trying to set a background pic
I tried to blit texture to framebuffer after calling clear()
and something definitely went wrong. in log I see that it resized (lowered) resolution when loaded the texture, but thats not the whole problem I guess. and I'd like resolution to stay high enough, like 800x480.
could you please tell me how I am supposed to do it?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Background pic
« Reply #1 on: August 22, 2010, 10:31:24 am »
A texture always have to have a size and width that's a power of 2. Everything else will be scaled down. If you really need a 1-to-1-blit of the source image (which will fit one resolution only anyway), you have to split it into several power of 2 texture. If that's not needed, i suggest to scale your background to 512*512 and blit that onto the 800*480 screen. That should look good enough in most cases.

Offline vael

  • byte
  • *
  • Posts: 10
    • View Profile
Re: Background pic
« Reply #2 on: August 22, 2010, 12:50:16 pm »
that's right, thanks for explanation :)

Offline vael

  • byte
  • *
  • Posts: 10
    • View Profile
Re: Background pic
« Reply #3 on: August 22, 2010, 12:58:28 pm »
oh and one more question please :)
is there in alternative to ReflectionHelper in Android version of jPCT?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Background pic
« Reply #4 on: August 22, 2010, 05:12:36 pm »
No, there isn't. Open GL 1.1 doesn't really support this and even if it would, it would be much too slow.