Get supported resolutions?

Hi everyone.

Is there any way to get the supported resolutions?
I’m using OpenGL.

sdl can do that. I clicked “index” in the “docs” folder and then clicked “video”. It said this is a supported function: SDL_ListModes

Hello Team,
We were running this sample example to findout the available modes, on the LCD tv.

#include <SDL/SDL.h>
#include <stdio.h>

int main(int argc, char argv[]) {
Information about the current video settings. /
Initialize defaults, Video and Audio */
SDL_Rect **fullmodes;
int i;
printf(“Could not initialize SDL: %s.\n”, SDL_GetError());
const SDL_VideoInfo *vidInfo = NULL;
vidInfo = SDL_GetVideoInfo ();

/* collect all fullscreen & hardware modes available */
if (!(fullmodes = SDL_ListModes (vidInfo->vfmt,SDL_OPENGL))) {

printf( “SDL Mode: %d: %d x %d\n”, i, fullmodes[i]->w, fullmodes[i]->h);
else {

printf(“FullMode Eror\n”);

The program always fails to list the fullmode.

(c) 2007-2009 Intel Corporation 
(c) 2001-2008 The world wide DirectFB Open Source Community 
(c) 2000-2004 Convergence (integrated media) GmbH---------------------------------------------------------------- 

(*) DirectFB/Core: Single Application Core. (2011-06-09 00:06) 
(*) IntelCE/Systems: Available GDL driver memory: 55MB of 70MB 
(*) Direct/Thread: Started 'Hotplug with Linux Input' (3070) [INPUT OTHER/OTHER 0/0] <8388608>... 
(*) DirectFB/Input: Hotplug detecting enabled with Linux Input Driver 
(*) DirectFB/Genefx: MMX detected and enabled 
(*) IntelCE/GfxDriver: Using OpenGL ES 1.1 graphics library 
(*) IntelCE/GfxDriver: Using SRB graphics library 
(*) DirectFB/Graphics: Intel Corporation Intel_CE Graphics Driver 2.0 (Intel Corporation) 
(*) DirectFB/Core/WM: Default 0.3 ( 
FullMode Eror 
(!!!) *** WARNING [Application exited without deinitialization of DirectFB!] *** [core.c:871 in dfb_core_deinit_check()] 
(!!!) *** WARNING [still 1 objects in pool:'Layer Region Pool'] *** [object.c:359 in fusion_object_pool_destroy()] 
(!!!) *** WARNING [still 1 objects in pool:'Layer Context Pool'] *** [object.c:359 in fusion_object_pool_destroy()] 

IntelAtomProcessor connected to LCD tv thru A/V out .DirectFb example programs are working fine and displays pictures and screen savers on TV. 
SDL-1.2 Version. 
Direct FB-1.2.10. 
Any Help on this will be really helpful. 

Well I’m using this for detection on Win32

	int				displaynum = 0;
	memset(&display, 0, sizeof(display));
	display.cb = sizeof(display);

	// Monitor List
	while(EnumDisplayDevices(NULL, displaynum++, &display, NULL))
		// Default monitor
			DEVMODE	devmode;
			memset(&devmode, 0, sizeof(devmode));
			devmode.dmSize = sizeof(devmode);
			int num = 0;
			while (EnumDisplaySettings(display.DeviceName, num++, &devmode))
                               // We only want stuff bigger than 640x480 probably
				if (devmode.dmBitsPerPel >=16 && devmode.dmPelsWidth >= 640 && devmode.dmPelsHeight >= 480)
					/* Important stuff

					// Push to list

Hope it helps

SDL_LISTMODES is being used by Mplayer and Mplayer crashes, when it tries to access the fullmodes.
Even if we add a NULL pointer check the functionality does not work , when i tried the example program i get to see that
SDL_ListModes is not working as per documentation, so it is very important for me to get the example program working so that Mplayer also runs fine.
SO any help on successfully using this function is very much appreciated.
SDL_Rect **fullmodes;
if (!(fullmodes = SDL_ListModes (vidInfo->vfmt,SDL_SWSURFCE|SDL_FULLSCREEN))) {

printf( “SDL Mode: %d: %d x %d\n”, i, fullmodes[i]->w, fullmodes[i]->h);