Enumerating display modes
Enumerating display modes
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?
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
}
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way