The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Small assets on high resolution SDL_Window
Alvin Beach
Guest

Hello all,

I've noticed that on high resolution displays (e.g. Dell XPS13 laptop and Samsung Galaxy Tab PRO)
that my assets (e.g. icons, images, text, etc.) render very small. I'm just curious what others do
in these situations? I've poked around in the SDL wiki, Google and, in the case of Android, the
Android source in SDL2, but haven't found a clear way to manage this.

For instance, the Tab PRO has a resolution of 2560x1600 and all my widgets images (via SDL_image)
and text (via SDL_ttf) are extremely tiny. On the Dell XPS13, the effect wasn't too bad, so I just
increased the font size as the images weren't too small.

Is SDL_RenderSetLogicalSize() the way to handle this? If so, do you just call
SDL_RenderSetLogicalSize() when the actual SDL_Window is "too large"?

Or, in the case on Android, is there some magical setting in AndroidManifest.xml that I could use to
"normalise" the SDL_Window across devices?

Correct me if I am wrong, but I'm thinking that this is an issue with the monitor/display rather
than with the platform. I would prefer a solution that would work on both the Dell XPS13 and
Android. But, maybe that isn't possible?

Many thanks.

Cheers,

Alvin
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
alabouza


Joined: 08 Dec 2009
Posts: 48
Location: Sao Paulo , Brasil
Hi, Alvin.
I have experienced the same situation in my applications.
For the particular case of Windows 8.1 I used resources from "DPI aware" API, as advised by Eric Wasylishen in this forum.
A possible, but not perfect solution, could be the scaling, available in SDL2, at the cost of some blurring. Using : SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); and SDL_RenderSetLogicalSize();
In the long run, we will need several set of fonts, buttons, etc and select them at runtime for a better look.
Regards,
Armando
Small assets on high resolution SDL_Window
Alvin Beach
Guest

On Sun, Mar 1, 2015 at 9:17 PM, alabouza wrote:
Quote:
Hi, Alvin.
I have experienced the same situation in my applications.
For the particular case of Windows 8.1 I used resources from "DPI aware"
API, as advised by Eric Wasylishen in this forum.
A possible, but not perfect solution, could be the scaling, available in
SDL2, at the cost of some blurring. Using :
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); and
SDL_RenderSetLogicalSize();
In the long run, we will need several set of fonts, buttons, etc and select
them at runtime for a better look.
Regards,
Armando

Thanks for the feedback!

In the end I gave SDL_RenderSetLogicalSize() a try. In my situation,
my widgets hug the edges of the window and are relative to each other.
To make it work I just had to replace all calls to SDL_GetWindowSize()
with SDL_RenderGetLogicalSize(). On displays where I do not really
need to set a logical size, I simply set the logical size to the
actual window dimensions (otherwise I just get 0x0). This just allowed
me to stick to just SDL_RenderGetLogicalSize(). So far it seems "good
enough" in terms of speed and look and feel.

Cheers,

Alvin
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org