How to deal with Retina

Previous topic - Next topic

Kitty Hello

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.

Hark0

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

Kitty Hello

no. You want that for all platforms then. :D

Hark0

http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

ampos

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

jaywat

#5
Quote from: ampos 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.

ampos

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

Kitty Hello

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?

Moebius

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

Leginus

Android   :enc:  glbasic strikes again.

XanthorXIII

@Kitty - Just proving to me each day GLBasic was the best purchase I have made in a long time.

Owlcat has wise

Ian Price

GLBasic supporting Android and AppUp? Christmas has come early :D
I came. I saw. I played.

matchy

Huh? :blink: Wha?  O_O Android?!  :noggin: No?  :zzz: Really?  :noggin:

Ian Price

Quote from: matchy 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.

ampos

Quote from: Ian Price 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