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
Scaling resolutions with Andriod SDL 1.2
Timodor


Joined: 14 Apr 2013
Posts: 72
Location: Australia
I want to have default resolution of like 800x480 for my game and scale up from any resolutions above.
I could do this on the PC with SDL fine with FULL_SCREEN mode.

With the android, It doesn't scale when you have the FULL_SCREEN mode. I'm using the software surface.

Anyone have any idea's?
Scaling resolutions with Andriod SDL 1.2
Sik


Joined: 26 Nov 2011
Posts: 905
Do you want to scale the framebuffer itself or just the coordinates of
what you draw? If the latter, you can just use
SDL_RenderSetLogicalSize at the beginning:.

Basically:
SDL_RenderSetLogicalSize(renderer, 800, 480);

In practice you'll want to take into account different aspect ratios though.

2013/4/26, Timodor:
Quote:
I want to have default resolution of like 800x480 for my game and scale up
from any resolutions above.
I could do this on the PC with SDL fine with FULL_SCREEN mode.

With the android, It doesn't scale when you have the FULL_SCREEN mode. I'm
using the software surface.

Anyone have any idea's?





_______________________________________________
SDL mailing list

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


Joined: 14 Apr 2013
Posts: 72
Location: Australia
I'm using SDL 1.2 I think

SDL_RenderSetLogicalSize is not included "SDL_RenderSetLogicalSize' was not declared in this scope"

I should be moving on to SDL 2.0, but I have no idea how it works.
Scaling resolutions with Andriod SDL 1.2
Sik


Joined: 26 Nov 2011
Posts: 905
Er right I missed 1.2 in the subject ^^; Yeah, it isn't present in
SDL2, sorry. You'll have to scale stuff yourself if you stick with
1.2.

2013/4/27, Timodor:
Quote:
I'm using SDL 1.2 I think

SDL_RenderSetLogicalSize is not included "SDL_RenderSetLogicalSize' was not
declared in this scope"

I should be moving on to SDL 2.0, but I have no idea how it works.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Scaling resolutions with Andriod SDL 1.2
Sik


Joined: 26 Nov 2011
Posts: 905
*It's only present in SDL2, not in 1.2, gah

2013/4/27, Sik the hedgehog:
Quote:
Er right I missed 1.2 in the subject ^^; Yeah, it isn't present in
SDL2, sorry. You'll have to scale stuff yourself if you stick with
1.2.

2013/4/27, Timodor:
Quote:
I'm using SDL 1.2 I think

SDL_RenderSetLogicalSize is not included "SDL_RenderSetLogicalSize' was
not
declared in this scope"

I should be moving on to SDL 2.0, but I have no idea how it works.






_______________________________________________
SDL mailing list

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


Joined: 14 Apr 2013
Posts: 72
Location: Australia
Issue is now resolved, I ported the entire game to OpenGL 1.1 ES using the NDK and C++

used this command : glOrthof( 0.0, 480, 800, 0.0, 0.0, 1.0 ); //STRETCHING

Thing is you also need to updated the X POS and Y POS to the res your stretching to.

EG if the phone is 1080X1920 and you want it on 800x480. The screen touch must be scaled down to that resolution. It works like charm, scale down and up.
Scaling resolutions with Andriod SDL 1.2
Gabriele Greco
Guest

Quote:
EG if the phone is 1080X1920 and you want it on 800x480. The screen touch must be scaled down to that resolution. It works like charm, scale down and up.






Using SDL_RenderSetLogicalSize on SDL2, will do the event coordinate scaling for you, you'll be able to use the SDL_Texture API for your drawing, that is significantly simpler than using quads yourself.

--
Bye, Gabry