Loading a new scene
2 posters
Loading a new scene
Someone asked about loading scenes using custom loading (good practice of lazy loading for iPhone memory usage).
I want to verify that this is the correct way to accomplish this:
1) First release previous scene
// release previous scene
sio2ResourceUnloadAll( sio2->_SIO2resource );
sio2->_SIO2resource = sio2ResourceFree( sio2->_SIO2resource );
sio2->_SIO2resource = 0;
2) Load in a new scene
// load in new scene
sio2->_SIO2resource = sio2ResourceInit();
sio2->_SIO2window->_SIO2windowrender = loadScene( sceneName );
void loadScene( const char* resourceFile ) {
//
// same as templateLoading() but
// with this line you provide the passed in resource file name
sio2ResourceOpen( sio2->_SIO2resource, resourceFile, 1 );
...
}
Thanks for this engine, great work! Very helpful to visualize in blender and then dump out to code, real time saver:)
Bullet physics is great too.
-Tim
I want to verify that this is the correct way to accomplish this:
1) First release previous scene
// release previous scene
sio2ResourceUnloadAll( sio2->_SIO2resource );
sio2->_SIO2resource = sio2ResourceFree( sio2->_SIO2resource );
sio2->_SIO2resource = 0;
2) Load in a new scene
// load in new scene
sio2->_SIO2resource = sio2ResourceInit();
sio2->_SIO2window->_SIO2windowrender = loadScene( sceneName );
void loadScene( const char* resourceFile ) {
//
// same as templateLoading() but
// with this line you provide the passed in resource file name
sio2ResourceOpen( sio2->_SIO2resource, resourceFile, 1 );
...
}
Thanks for this engine, great work! Very helpful to visualize in blender and then dump out to code, real time saver:)
Bullet physics is great too.
-Tim
freebird373- Posts : 10
Join date : 2008-11-21
Re: Loading a new scene
Yup you get it all covered... what you can do also is:
1. Create another thread using SIO2thread
2. Create another SIO2resource handle
3. Load all the resources in the other thread
4. Then GenId in the main thread when its done loading... and bind the SIO2resource handle...
(just make sure that you are not calling any GL instruction while loading the resource from the other thread as there's no GL context created)
Hope this help!
Cheers,
1. Create another thread using SIO2thread
2. Create another SIO2resource handle
3. Load all the resources in the other thread
4. Then GenId in the main thread when its done loading... and bind the SIO2resource handle...
(just make sure that you are not calling any GL instruction while loading the resource from the other thread as there's no GL context created)
Hope this help!
Cheers,
Similar topics
» loading more than once scene
» The widget in the 3D scene
» How to change the scene?
» Scene Graph
» 3d scene draw a 2d image.
» The widget in the 3D scene
» How to change the scene?
» Scene Graph
» 3d scene draw a 2d image.
Permissions in this forum:
You cannot reply to topics in this forum