// 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 :?
// 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!!!
Hmm - well done 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.