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.
Mircea Popescu
Posts: 26 Joined: Sat Jan 02, 2010 12:48 pm
Post
by Mircea Popescu » Tue Jan 05, 2010 3:16 pm
I don't understand why getvideodriver() is called twice in the demo example ? Namely, once in cdemo::run
Code: Select all
void CDemo::run()
{
[...]
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment* guienv = device->getGUIEnvironment();
[...]
}
and then in cdemo::loadscenedata
Code: Select all
void CDemo::loadSceneData()
{
// load quake level
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* sm = device->getSceneManager();
[...]
}
What is the point of doing this ? Thanks.
Acki
Posts: 3496 Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:
Post
by Acki » Tue Jan 05, 2010 4:26 pm
maybe because device is global and driver and sm are not and this are two different functions !?!?!
just a wild guess !!!
Mircea Popescu
Posts: 26 Joined: Sat Jan 02, 2010 12:48 pm
Post
by Mircea Popescu » Tue Jan 05, 2010 5:22 pm
Well yes, but moreover, why would you want to do that ?! I mean logically, do all the video stuff in one function, rather than have to get the device twice ? No ?
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Tue Jan 05, 2010 5:37 pm
No, there are two drivers used, hence also two calls.
Mircea Popescu
Posts: 26 Joined: Sat Jan 02, 2010 12:48 pm
Post
by Mircea Popescu » Tue Jan 05, 2010 6:07 pm
Hm... well I still can't quite figure why that is.
And since we're on the can't figure line, why does changing the resolution to 1024 768 crash the screen shoots ? (ie, if I modify
Code: Select all
core::dimension2d<u32> resolution ( 800, 600 );
in cdemo.cpp to 1024, 768, pressing F9 crashes the demo).
Mircea Popescu
Posts: 26 Joined: Sat Jan 02, 2010 12:48 pm
Post
by Mircea Popescu » Tue Jan 05, 2010 6:19 pm
With some testing it turns out the 1024x768 resolution issue was a local problem, strictly due to bad directx9/videocard interaction. Nothing to do with Irrlicht
Acki
Posts: 3496 Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:
Post
by Acki » Wed Jan 06, 2010 4:07 pm
Mircea Popescu wrote: Well yes, but moreover, why would you want to do that ?! I mean logically, do all the video stuff in one function, rather than have to get the device twice ? No ?
if you like so then do it...
I also do it this and other ways in different projects...
and note that there are not 2 drivers in question, just 2 pointers to THE driver !!!