Using Multiple Resources and sio2 files
2 posters
Using Multiple Resources and sio2 files
I am trying to figure out how to use multiple resources for loading different levels in my sio2 project, and I have looked over all of the other discussions on this forum about how to implement multiple resources but I still cant seem to get it working.
As I understand it the necessary parts of code are:
But it doesn't work obvoiusly. I get an 'error at this point in file' at '
sio2->_SIO2resource = monkey = sio2ResourceInit();' but I think there are more problems than that.
Could anyone else supply some code that they might have used to implement multiple resources? I feel like I am so close to having worked it out but just dont know where I am going wrong.
Any help is greatly appreciated, SIO2 is amazing =)
As I understand it the necessary parts of code are:
- Code:
//Declaration of the SIO2resource names
SIO2resource *monkey = NULL;
SIO2resource *box= NULL;
...
...
sio2WindowEnterLandscape3D();
{
//Rendering of appropriate resources at appropriate times
if (monkey)
{
sio2ResourceRender( monkey,
sio2->_SIO2window,
_SIO2camera,
SIO2_RENDER_SOLID_OBJECT );
}
else
{
sio2ResourceRender( cube,
sio2->_SIO2window,
_SIO2camera,
SIO2_RENDER_SOLID_OBJECT );
}
...
...
void templateLoading( void )
{ ......
unsigned int i = 0;
sio2->_SIO2resource = monkey = sio2ResourceInit();
sio2ResourceCreateDictionary( monkey );
sio2ResourceOpen( monkey,
"tutorial02.sio2", 1 );
while( i != monkey->gi.number_entry )
{
sio2ResourceExtract( monkey, NULL );
++i;
}
i =0;
sio2->_SIO2resource = cube = sio2ResourceInit();
sio2ResourceCreateDictionary( cube );
sio2ResourceOpen( cube,
"tutorial02.sio2", 1 );
while( i != cube->gi.number_entry )
{
sio2ResourceExtract( cube, NULL );
++i;
}
// We are done with the file so close the stream.
sio2ResourceClose( monkey );
sio2ResourceClose( cube );
void templateShutdown( void )
{.....
sio2ResourceUnloadAll( monkey );
sio2->_SIO2resource = sio2ResourceFree( monkey );
}
But it doesn't work obvoiusly. I get an 'error at this point in file' at '
sio2->_SIO2resource = monkey = sio2ResourceInit();' but I think there are more problems than that.
Could anyone else supply some code that they might have used to implement multiple resources? I feel like I am so close to having worked it out but just dont know where I am going wrong.
Any help is greatly appreciated, SIO2 is amazing =)
monkeys- Posts : 8
Join date : 2009-07-22
Re: Using Multiple Resources and sio2 files
Check the iZenGarden source... you will have a concrete example on that... everything is independent, the garden, the ui, bird, fish etc...
Similar topics
» Custom resources
» rendering multiple resources
» Problem using multiple source files
» .CPP files using the SIO2.h include?
» Request: glut+SIO2 project template with SIO2 releases.
» rendering multiple resources
» Problem using multiple source files
» .CPP files using the SIO2.h include?
» Request: glut+SIO2 project template with SIO2 releases.
Permissions in this forum:
You cannot reply to topics in this forum