Android: SetVideoMode to 800x480 doesnt seem to work

Hello,

I used another SDL Port in the past and had a screen resolution of 800x480 on my HTC desire
2.2 and 2.3.

Now with the current content of the repository it doesnt seem to switch correctly to 800x480.

It looks more like 320x480 or similar. Any ideas what I am doing wrong? Pls help Thx!

andreas

btw my flags

#define VIDEO_FLAGS (SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF |SDL_OPENGL| SDL_NOFRAME)

My startup code looks something like this:

Code:
// Initialize SDL.
ASSERT_SDL(SDL_Init(SDL_INIT_VIDEO) >= 0, “Initialising SDL video”);

// Open the window where we will draw. NB: Android will override the
// specified height and width no matter what they are!
window = SDL_CreateWindow(APP_NAME, SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, WINDOW_DEFAULT_W,
WINDOW_DEFAULT_H, WINDOW_FLAGS);
ASSERT_SDL(window, “Opening SDL application window”);

// Since the window size can be overriden, check what it is actually
SDL_GetWindowSize(window, &global::viewport.w, &global::viewport.h);

In other words I request a given screen resolution but this value is completely ignored by Android: you are assigned a resolution based on… well, I’d always assumed it was the maximum resolution of the device. Use the last line of code to find out what resolution you’ve actually been granted: if it’s not your maximum resolution I’m afraid you’ll need to dig around in the glue-code to find out how the value is assinged :?

wilbefast wrote:

My startup code looks something like this:

Code:
// Initialize SDL.
ASSERT_SDL(SDL_Init(SDL_INIT_VIDEO) >= 0, “Initialising SDL video”);

// Open the window where we will draw. NB: Android will override the
// specified height and width no matter what they are!
window = SDL_CreateWindow(APP_NAME, SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, WINDOW_DEFAULT_W,
WINDOW_DEFAULT_H, WINDOW_FLAGS);
ASSERT_SDL(window, “Opening SDL application window”);

// Since the window size can be overriden, check what it is actually
SDL_GetWindowSize(window, &global::viewport.w, &global::viewport.h);

In other words I request a given screen resolution but this value is completely ignored by Android: you are assigned a resolution based on… well, I’d always assumed it was the maximum resolution of the device. Use the last line of code to find out what resolution you’ve actually been granted: if it’s not your maximum resolution I’m afraid you’ll need to dig around in the glue-code to find out how the value is assinged :?

I finally found it! As soon as I specify

It begins to work and I get higher screen resolutions. So it was about the Sdk version used!!!

andreas

Hmm - well done :slight_smile: There’s quite a lot that needs to be tweak specifically for each Android app: if you plan to publish the result you’ll need, for example, to change the package names (only one app per name can exist on the market) from the default, which I think is something like org.libsdl.app or something. I was plagued by problems related to OpenGLES 1.1 vs 2.0 (ended up deactivating the first): depending on the device’s OS version things may run quite differently, so the more constraints you specify the better.