Author Topic: Different screen resolutions  (Read 1583 times)

Offline Kaiidyn

  • long
  • ***
  • Posts: 103
    • View Profile
Different screen resolutions
« on: March 05, 2011, 02:19:38 pm »
Just some thoughts here.

I am developing on a SGS with a screen res of 800x480...
I was thinking about blitting etc for graphical user interface (menu, hud, etc)
But how can I take different screen resolutions into account, eg 480x320...


edit: I got a loading texture 800x480 that I want to blit, but Texture says that 800 is unsupported width, how would I go about making loading texture?
« Last Edit: March 05, 2011, 08:46:45 pm by Kaiidyn »
Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control. - Grady Booch

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Different screen resolutions
« Reply #1 on: March 05, 2011, 08:11:22 pm »
The smartest solution would be to do the blitting in normalized screen space ([0..1]) and calculate the real screen coordinates based on the actual resolution. In Alien Runner, i didn't use normalized coordinates but i recalculate coordinates based on the actual resolution compared to the resolution that i used for development. For example a blit to x=400 on my 480*320 screen is blitted to 400*(800/480)=666 on a screen with a width of 800.

Offline BennyFrandsen

  • byte
  • *
  • Posts: 1
    • View Profile
Re: Different screen resolutions
« Reply #2 on: March 25, 2011, 01:09:14 pm »
Hey guys,
i am from germany, therefore sorry for my poor english :'(
I started with jPCT few weeks ago and i also have a short question about screen resolutions.

The 2D Interface blitting thing is clear but for example i load a skybox modell and place this far away . The only thing i have to do to make this screen size indepent is to calculate for each screen size the scaling value from the 3dModell.
On a device with a 480x320 i would use for example the scaling factor 2
On a device with 800x480 i would use the scaling factor ~3.5
Is this the correct way?
Thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Different screen resolutions
« Reply #3 on: March 25, 2011, 01:23:05 pm »
3d will look the same no matter which resolution the output device uses (just more jagged). No need to scale it.