x.draw() not drawing :(

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
desijays
Posts: 4
Joined: Thu Apr 05, 2007 4:06 am

x.draw() not drawing :(

Post by desijays »

Im just getting used to the API and am very new to game programming as such.

i tried to access the file open dialog with the following command.

Code: Select all

gui::IGUIElement x = gui::IGUIElement( gui::EGUIET_FILE_OPEN_DIALOG, guienv, guienv->getFocus(), 1, core::rect<s32>( 100, 150, 200, 250 ) );
where,

guienv is an object of type irr::gui::IGUIEnvironment;

I've already set up everything else and somehow got the window to show but i'm not able to get the file open dialog to show.

this is my while loop

Code: Select all


while( device->run() )
	{
		driver->beginScene( true, false, video::SColor( 0, 255, 155, 55 ) );
		guienv->drawAll();
		x.draw();
		driver->endScene();
	}
where,

x is the object i created in the first statement.

But its still not drawing. what could i do?

If im doing something really stupid, please bare with me
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It might be a good idea for you to play around with the examples a bit before you jump right into things. It might save you some time and energy. Anywyas, if you want to create a file open dialog, you should do this...

Code: Select all

// assumes device is created like it is in every one of the Irrlicht examples.
gui::IGUIEnvironment* gui = device->getGUIEnvironment();
gui->addFileOpenDialog();
Unless you are doing something special, you should not have to call draw() on your gui elements. That will be done automatically when you call gui->drawAll() in the render loop.

Travis
Post Reply