Scaling resolutions with Andriod SDL 1.2

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?

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 :> 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?

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.

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 :> 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.

*It’s only present in SDL2, not in 1.2, gah

2013/4/27, Sik the hedgehog <@Sik_the_hedgehog>:> 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 :

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.

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.

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