Enumerating display modes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Munger
Posts: 28
Joined: Sun Mar 04, 2007 11:39 am
Location: Tokyo

Enumerating display modes

Post by Munger »

Correct me if I'm wrong, but I can't see a way to enumerate the display modes using pure Irrlicht. Am I missing something? How are other Irrlicht projects handling it?
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

Yes you are missing something

Code: Select all

   IVideoModeList *vList = device->getVideoModeList();
	u32 modesCount = vList->getVideoModeCount(); //Count of all available Resolutions
	dimension2di currentRes = device->getVideoDriver()->getScreenSize(); //Current Resolution
	//Iterate all available Resolutions
	for(u32 i = 0; i < modesCount; i++)
	{

		dimension2di res = vList->getVideoModeResolution(i);		
		//do something with it
	}
Munger
Posts: 28
Joined: Sun Mar 04, 2007 11:39 am
Location: Tokyo

Post by Munger »

Thanks. That looks promising.
geckoman
Posts: 143
Joined: Thu Nov 27, 2008 11:05 am
Location: Germany
Contact:

Post by geckoman »

I use this code in my game, so I know it works :D
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Note that for the above code you can create an EDT_NULL device in order to do the enumeration, then drop() it and create a real one with the selected resolution.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply