Author Topic: How to deal with Retina  (Read 7518 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
How to deal with Retina
« on: 2010-Dec-08 »
Hi,

now, the iPhone can have 320x480 or 640x960 resolution. How do you want to handle that?

My idea: You get a command GETDESKTOPSIZE sx%, sy% - if that's 2x the 320x480, you have to render to a frame buffer and scale that to the screen (or you use glScalef before you draw).

Other ideas: You set the screen size in hte project to 640x960 and if it's supported GETSCREENSIZE will tell you. Otherwise the screen will be limited to 320x480 and you have to deal with that.

I think method 1 is the best.

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: How to deal with Retina
« Reply #1 on: 2010-Dec-08 »
Another idea:

iScale n

n=1 for 100% screen resolution.
n=2 for 2X Scale

or

SETSCREEN width#, height#, fullscreen#, SCALE#
 
;)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: How to deal with Retina
« Reply #2 on: 2010-Dec-08 »
no. You want that for all platforms then. :D

Offline Hark0

  • Prof. Inline
  • *****
  • Posts: 1020
  • Geek Developer
    • View Profile
    • LitioPixel - Desarrollo de videojuegos con GLBasic | Videogame development with GLBasic
Re: How to deal with Retina
« Reply #3 on: 2010-Dec-09 »
Ops!
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: How to deal with Retina
« Reply #4 on: 2010-Dec-09 »
I don't understand method 1... Wouldn't we have a doubled (retina) resolution but with doubled pixels (as currently the iPhone does)?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline jaywat

  • Mr. Drawsprite
  • **
  • Posts: 68
    • View Profile
Re: How to deal with Retina
« Reply #5 on: 2010-Dec-09 »
I don't understand method 1... Wouldn't we have a doubled (retina) resolution but with doubled pixels (as currently the iPhone does)?

That's how I read it too, and it seems pointless even supporting the resolution if you're just going to pixel-double it. That's what happens right now automatically if you run a 320x480 project on a retina display. The point of supporting the resolution at all is surely for us to be able to take advantage of the higher resolution screen capability?

Why don't you just give us the resolution as a project option like any other and let us decide what to do with it, rather than try and implement some special case? It's pretty trivial to supply higher res graphics and scale them down if a lower res screen. Or to even use a different media directory depending on supported resolution.

Obviously yes, we would need a reliable way to detect the actual screen supported resolution.

edit: Oh wait. I see why you're trying to figure out a workaround type method... because SETSCREEN doesn't work on an iDevice. ONLY the project option makes any difference. So if we did a retina resolution project and it was actually a low res screen, you'd see the top left corner of the project. Right? Well, in that case, the only logical answer is that SETSCREEN really NEEDS to work to override project settings so that we can write a 'universal' version.

If you don't, then we would have the utterly ludicrous situation where you'd have to deploy an iPad version, an iPhone (Retina) version, and an iPhone (Standard) version. Frankly I don't even think Apple would let you.

But in that case, my point still stands... if we can't actually use and react to SETSCREEN... why bother supporting a retina device at all? It automatically pixel-doubles from 320x480. Which appears to be what you're proposing anyway.

Assuming that you can't get SETSCREEN to actually work, which would be by far the best situation all round, then your described method 2, 'fall back from Retina to standard', would be best, because at least we can take advantage of that higher resolution.
« Last Edit: 2010-Dec-09 by jaywat »

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: How to deal with Retina
« Reply #6 on: 2010-Dec-09 »
If SETSCREEN does (and will not) work, then we can/could make IPad resolution proyects, and check real resolution, as (maybe) iOS will fall back to closest resolution (iPad -> Retina -> Std, 1024->960->480).
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10715
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: How to deal with Retina
« Reply #7 on: 2010-Dec-09 »
Currently you have a back buffer on Retina of 640x960. If you don't support that resolution, the program internally scales up the graphics x2 to that framebuffer. (That's what GLBasic does right now).

My idea is: on a retina you get GETDESKTOPSIZE with 640x960 and 3G gives 320x480. Then you can decide "what" you draw on that screen. So, if your game is 320x480 on a retine, it would only fit 1/4 of the screen now. You would have to take care manually to scale it up to 640x960 or really use that resolution.

The background is, once we port to Android, you _will_ get in the situation where every device has a different resolution and you have to adjust your program to cope with it. So the idea was to introduce that "GETDESKTOPSIZE" to get the idea what size you have. And on handheld devices you always make fullscreen apps, so you have to take care about filling the unwanted space.

Good idea?

Offline Moebius

  • Dr. Type
  • ****
  • Posts: 315
    • View Profile
Re: How to deal with Retina
« Reply #8 on: 2010-Dec-09 »
So could we have GETDESKTOPSIZE on all platforms?  It would be a useful addition.  Also on handheld devices with varying resolutions, if the program doesn't SETSCREEN to the correct fullscreen resolution, will it automatically be scaled?  This would be useful on Android if one can't be bothered to adapt to different resolutions  :whistle:
Anyway, supporting retina resolution sounds great, not to mention the mention of Android  =D
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Offline Leginus

  • Dr. Type
  • ****
  • Posts: 288
    • View Profile
Re: How to deal with Retina
« Reply #9 on: 2010-Dec-09 »
Android   :enc:  glbasic strikes again.

Offline XanthorXIII

  • Mr. Polyvector
  • ***
  • Posts: 197
    • View Profile
Re: How to deal with Retina
« Reply #10 on: 2010-Dec-09 »
@Kitty - Just proving to me each day GLBasic was the best purchase I have made in a long time.

Owlcat has wise

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: How to deal with Retina
« Reply #11 on: 2010-Dec-09 »
GLBasic supporting Android and AppUp? Christmas has come early :D
I came. I saw. I played.

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: How to deal with Retina
« Reply #12 on: 2010-Dec-09 »
Huh? :blink: Wha?  O_O Android?!  :noggin: No?  :zzz: Really?  :noggin:

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4147
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: How to deal with Retina
« Reply #13 on: 2010-Dec-09 »
Huh? :blink: Wha?  O_O Android?!  :noggin: No?  :zzz: Really?  :noggin:

And Caanoo too, judging by THIS post on GP32x...
I came. I saw. I played.

Offline ampos

  • Prof. Inline
  • *****
  • Posts: 1594
    • View Profile
    • AMpostata Website
Re: How to deal with Retina
« Reply #14 on: 2010-Dec-09 »
GLBasic supporting Android and AppUp? Christmas has come early :D

Do you know that Fool's day in Spain is Dec 28th?

 :enc:
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE