Vous devez écrire le code dans templateRender comme suit
void templateRender(void)
{
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
SIO2camera *_SIO2camera = (SIO2camera *)sio2ResourceGet(
sio2->_SIO2resource, SIO2_CAMERA, "camera/Camera");
if(_SIO2camera)
{
// Adjust the perspective, please take not
// that this operation should only be done
// once everytime you are switching cameras.
sio2Perspective(_SIO2camera->fov,
sio2->_SIO2window->scl->x/sio2->_SIO2window->scl->y,
_SIO2camera->cstart,
_SIO2camera->cend);
// Enter the 3D landscape mode
sio2WindowEnterLandscape3D();
{
sio2CameraRender(_SIO2camera);
sio2ResourceRender(sio2->_SIO2resource,
sio2->_SIO2window,
_SIO2camera,
SIO2_RENDER_SOLID_OBJECT);
}
sio2WindowLeaveLandscape3D();
}
}
Puis, en templateLoading
:
void templateLoading(void)
{
unsigned int i = 0;
sio2ResourceCreateDictionary(sio2->_SIO2resource);
sio2ResourceOpen(sio2->_SIO2resource,
"Tutorial1.sio2", 1);
while(i != sio2->_SIO2resource->gi.number_entry)
{
sio2ResourceExtract(sio2->_SIO2resource, NULL);
++i;
}
sio2ResourceClose(sio2->_SIO2resource);
sio2ResourceBindAllMatrix(sio2->_SIO2resource);
sio2ResourceGenId(sio2->_SIO2resource);
sio2ResetState();
sio2->_SIO2window->_SIO2windowrender = templateRender;
}