Getting screen resolution?

Sorry; total SDL noob here. I’m trying to get the current screen resolution, but not having much success. My goal is to determine the screen resolution up front and then use some different assets depending on the resolution.

Found it after a little more digging and trial and error. I ended up using the following. I understand I could enumerate all of the different displays, but since I’m targeting mobile phones I’m really only interested in the zero index display.

Code:

SDL_DisplayMode current;
SDL_Init(SDL_INIT_VIDEO);
SDL_GetCurrentDisplayMode(0, &current);

[/code]

2013/9/24 bigtunacan <joiey.seeley at gmail.com>

**
Found it after a little more digging and trial and error. I ended up using
the following. I understand I could enumerate all of the different
displays, but since I’m targeting mobile phones I’m really only interested
in the zero index display.

Code:

SDL_DisplayMode current;
SDL_Init(SDL_INIT_VIDEO);
SDL_GetCurrentDisplayMode(0, &current);

[/code]

Does SDL_GetDesktopDisplayMode() not work on mobile?

It may not, and that would be a bug.

Can you report it on the platforms you’re seeing the issue?
http://bugzilla.libsdl.org/

Thanks!On Wed, Sep 25, 2013 at 8:40 AM, Jonas Kulla wrote:

2013/9/24 bigtunacan <joiey.seeley at gmail.com>

**
Found it after a little more digging and trial and error. I ended up
using the following. I understand I could enumerate all of the different
displays, but since I’m targeting mobile phones I’m really only interested
in the zero index display.

Code:

SDL_DisplayMode current;
SDL_Init(SDL_INIT_VIDEO);
SDL_GetCurrentDisplayMode(0, &current);

[/code]

Does SDL_GetDesktopDisplayMode() not work on mobile?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org