[fltk.coredev] Re: RFC: API for screen sizes on mobile devices

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: API for screen sizes on mobile devices Manolo 02:38 Sep 02 top right image
 

On Wednesday, September 2, 2020 at 10:21:58 AM UTC+2 Matthias wrote:

Hi there,

I am hoping for a good idea to manage screen size on Android. The physical resolution and density can be pretty much anything (for example, the Galaxy Note 10 Plus has 6.8-inch at 3040x1440 pixel), but apps are often written for a fixed scale and can request a different pixel buffer resolution that is then scaled up by hardware at screen refresh time. 
Does that mean "the developer writes the app for a pixel size s/he decides, and the hardware efficiently scales the
bitmap produced by the app to the true display size"?
In that case, the developer must respect the width/height ratio of the display.


Also, there should be an API to limit apps to landscape or portrait mode.

I was thinking about something like:
Fl::hint(FL_MOBILE_DEVICES, FL_SCREEN_LANDSCAPE_ONLY);
Fl::hint(FL_MOBILE_DEVICES, FL_SCREEN_LANDSCAPE_WIDTH, 1024);

Device: MOBILE, DESKTOP, ...
I'm not sure to understand that line.

Screen: LANDSCAPE_ONLY, PORTRAIT_ONLY, LANDSCAPE_WIDTH/HEIGHT, PORTRAIT_WIDTH/HEIGHT, ...
Is the intention to use only  WIDTH or only HEIGHT, and infer the other dimension considering the hardware display size?
Isn't an API to get the hardware width/height ratio necessary?


This API avoids #ifdef __ANDROID__ and can be extended later without breaking the ABI. Unsupported hints are simply ignored. 

Using Fl::screen_scale() is similar in that it would allow super high resolution rendering on Android, but it would use up a lot more resources (time and energy), and may slow down rendering considerably.
Does that mean "FLTK builds a bitmap the size of the display hardware, but transmits scaled units to the FLTK user. Just like
under Windows on a HighDPI screen."?
Is it sure this would be slower, since no bitmap scaling should be performed?


What do you think?

 - Matthias



--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/e8ef2e3f-86bc-4d86-8dd7-670b9e0ee772n%40googlegroups.com.
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2020 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.