Page 1 of 1

IVideoModeList ?

Posted: Thu Jan 22, 2004 4:52 am
by Battlestations
Hi,

I am trying to print the video mode list with a printf statment and am getting problems? How do i do it with this given.

Code: Select all

	s32 video_count = 0;
	s32 i = 0;
	device = createDevice(video::EDT_NULL,
		core::dimension2d<s32>(0, 0), 16, false, false, NULL);

	if(!device)
		return 0;

	IVideoModeList *video_list = device->getVideoModeList();
	video_count = video_list->getVideoModeCount();

	
	for( i = 0; i < video_count; i++)
	{
		printf(" Item:%i Mode:%s\n", i, video_list);//??

	}
	
	video_list->drop();
	device->drop();
Ok, now how do i print the list or get the info from video_list?
I tried several different things and am not getting any text. Am I not doing something right here?

Posted: Thu Jan 22, 2004 4:55 am
by keless
http://irrlicht.sourceforge.net/docu/cl ... eList.html

hrm, that doesnt seem to help very much. it doesnt seem to list video modes so much as give the current stats (res, color depth, etc)

Posted: Thu Jan 22, 2004 5:05 am
by Battlestations
Ok, so how do I get the list of available video choices..(part of that email i sent you about a template idea i wanted to make for a beginner, like I am)

Posted: Thu Jan 22, 2004 5:10 am
by keless
from the documentation, i cant really see how you can get a list form it-- just the current status.

here is a link to Saigumi's XML gui project:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=1095

Posted: Thu Jan 22, 2004 6:08 am
by Battlestations
Got It!

For anyone wanting to know how to enumerate em, here ya go..

Code: Select all

IrrlichtDevice *device = 0;
#include <stdio.h>
int main(int argc, const char *argv[])
{
	s32 video_count = 0;
	s32 i = 0;
	device = createDevice(video::EDT_NULL,
		core::dimension2d<s32>(0, 0), 16, false, false, NULL);

	if(!device)
		return 0;

	IVideoModeList *video_list = device->getVideoModeList();
	video_count = video_list->getVideoModeCount();
			
	for( i = 0; i < video_count; i++ )
	{
		printf(" Item:%i Resolution:%ix%i Depth:%i\n", i, video_list->getVideoModeResolution(i), video_list->getVideoModeDepth(i));

	}
This took way to long for me to figure out.. :(