loading more than once scene
2 posters
loading more than once scene
the normal code for opening a scene and extracting all its resources works fine. I want to add another object in though, so I want to open another scene file.
I added the same open/extract code into the templateRender() function, but it doesn't seem to work. I think it might be replacing the first scene with the second one.
What's the correct procedure for this?
here's my code
cheers
I added the same open/extract code into the templateRender() function, but it doesn't seem to work. I think it might be replacing the first scene with the second one.
What's the correct procedure for this?
here's my code
- Code:
sio2ResourceOpen( sio2->_SIO2resource,
"Scene1.sio2", 1 );
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceOpen( sio2->_SIO2resource,
"Scene2.sio2", 1 );
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
cheers
sodapunk- Posts : 7
Join date : 2008-09-28
Re: loading more than once scene
Hummmm not sure what can be wrong in your case but this is the code that I test to check if it work fine and it did:
sio2ResourceOpen( sio2->_SIO2resource,
"the_clearing.sio2", 1 );
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceOpen( sio2->_SIO2resource,
"tutorial08.sio2", 1 );
// In your code I don't see that you reset i to 0 maybe that's the problem?
i = 0;
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceBindAllImages( sio2->_SIO2resource );
sio2ResourceBindAllSoundBuffers( sio2->_SIO2resource );
sio2ResourceBindAllMaterials( sio2->_SIO2resource );
sio2ResourceBindAllInstances( sio2->_SIO2resource );
sio2ResourceBindAllPhysicObjects( sio2->_SIO2resource,
sio2->_SIO2physic );
sio2ResourceGenId( sio2->_SIO2resource );
sio2PhysicPlay( sio2->_SIO2physic );
sio2->_SIO2window->fps = 20;
// Set my rendering loop callback
sio2->_SIO2window->_SIO2windowrender = kmHomeScreenRender;
sio2ResourceOpen( sio2->_SIO2resource,
"the_clearing.sio2", 1 );
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceOpen( sio2->_SIO2resource,
"tutorial08.sio2", 1 );
// In your code I don't see that you reset i to 0 maybe that's the problem?
i = 0;
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceBindAllImages( sio2->_SIO2resource );
sio2ResourceBindAllSoundBuffers( sio2->_SIO2resource );
sio2ResourceBindAllMaterials( sio2->_SIO2resource );
sio2ResourceBindAllInstances( sio2->_SIO2resource );
sio2ResourceBindAllPhysicObjects( sio2->_SIO2resource,
sio2->_SIO2physic );
sio2ResourceGenId( sio2->_SIO2resource );
sio2PhysicPlay( sio2->_SIO2physic );
sio2->_SIO2window->fps = 20;
// Set my rendering loop callback
sio2->_SIO2window->_SIO2windowrender = kmHomeScreenRender;
Re: loading more than once scene
yeah I messed up and didn't put i=0;
thanks for that
thanks for that
sodapunk- Posts : 7
Join date : 2008-09-28
Similar topics
» Loading a new scene
» How to change the scene?
» EXC_BAD_ACCESS - Can't Load My .SIO2 Object-Scene?!
» The widget in the 3D scene
» 3d scene draw a 2d image.
» How to change the scene?
» EXC_BAD_ACCESS - Can't Load My .SIO2 Object-Scene?!
» The widget in the 3D scene
» 3d scene draw a 2d image.
Permissions in this forum:
You cannot reply to topics in this forum