renderOneFrame() in OSM Callback

celic

06-04-2006 15:07:28

Hello!

Maybe my question isn't related to OFusion itself as to Ogre, sorry for that.

I want simply to display the name of the Entity while loading the OSM scene.
In Azatorth I did it in the callback function, like this:


RenderWindow *wnd = Root::getSingleton()->getAutoCreatedWindow();
wnd->setDebugText( entity->getName() );
Root::getSingleton()->renderOneFrame();


I guess it's related to scene managers, but how could I specify which one to use?

Thanks in advance!

Lioric

06-04-2006 16:54:43

What "which to use" ? the sceneManager? the viewport?

celic

07-04-2006 07:54:49

Sorry for the posted code, it wasn't at all correct.

I think I've found the weak place, the idea is that the scene manager is created inside OSM scene loading, but the rest, the viewport, camera, etc.. are created after this. So, when I try to display a debug text I couldn't.

So, I want to know if I should make changes inside OSM, and maybe to add a new parameter which will be the scene manager, or there is a more elegant way?

Thanks!

Lioric

07-04-2006 17:12:33

You can pass your created Scene Manager to the OSMScene constructor and it will be used instead of creating a scene manager at scene loading

See the OSMScene contructor parameters

From the "Scene Loader" chapter of the User's guide

Scene Managers

The oScene loader library will automatically create and setup the scene manager as defined in the max Scene Properties panel, but the user can choose to create its own scene manager, in this case you can pass the created scene manager to the constructor of the oSceneLoader object.

In the later, the scene manager settings are responsibility of the client application, including:


SceneManagers and its settings (world geometry)
Shadows techniques
Shadows settings
Sky techniques
sky settings
Background color
Ambient light color

celic

10-04-2006 09:18:05

Thanks a lot, Lioric!! :)
Didn't know that OSM Loader already has this feature 8)

Thanks!