Starting with 1.3 template
3 posters
Starting with 1.3 template
Hi,
I've just updated and am trying to render a simple scene using V1.3 template project.
For some reason, whenever I touch or drag on the screen, I get intermittent flashes (my scene to BLACK) and back.
Here is the code for the template.mm: Am I forgetting something basic?
I've just updated and am trying to render a simple scene using V1.3 template project.
For some reason, whenever I touch or drag on the screen, I get intermittent flashes (my scene to BLACK) and back.
Here is the code for the template.mm: Am I forgetting something basic?
- Code:
#include "template.h"
#include "../src/sio2/sio2.h"
int loaded = 0;
void templateRender( void )
{
if (loaded == 0) {
unsigned int i = 0;
sio2ResourceCreateDictionary( sio2->_SIO2resource );
sio2ResourceOpen( sio2->_SIO2resource,
"MyScene.sio2", 1 );
while( i != sio2->_SIO2resource->gi.number_entry )
{
sio2ResourceExtract( sio2->_SIO2resource );
++i;
}
sio2ResourceClose( sio2->_SIO2resource );
sio2ResourceResetState();
sio2ResourceBindAllImages( sio2->_SIO2resource );
sio2ResourceBindAllMaterials( sio2->_SIO2resource );
sio2ResourceBindAllMatrix( sio2->_SIO2resource );
sio2ResourceGenId( sio2->_SIO2resource );
loaded = 1;
}
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
if( !sio2->_SIO2camera )
{
SIO2camera *_SIO2camera = ( SIO2camera * )sio2ResourceGet( sio2->_SIO2resource,
SIO2_CAMERA,
"camera/Camera" );
sio2->_SIO2camera = _SIO2camera;
sio2CameraSetPerspective( _SIO2camera, sio2->_SIO2window );
}
sio2CameraUpdateDir( sio2->_SIO2camera );
sio2CameraRender( sio2->_SIO2camera );
sio2CameraUpdateFrustum( sio2->_SIO2camera );
// Run the culling algorithm on the
// current scene.
sio2ResourceCull( sio2->_SIO2resource,
sio2->_SIO2camera );
// Render the solid object (the plane) and
// our main emitter (if visible)
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT );
// Make sure that all material machine states
// are resetted.
sio2MaterialReset();
}
void templateShutdown( void )
{
// Clean up
sio2->_SIO2window = sio2WindowFree( sio2->_SIO2window );
sio2ResourceUnloadAll( sio2->_SIO2resource );
sio2->_SIO2resource = sio2ResourceFree( sio2->_SIO2resource );
sio2 = sio2Shutdown();
printf("\nSIO2: shutdown...\n" );
}
void templateScreenTap( void *_ptr, unsigned char _state )
{
}
void templateScreenTouchMove( void *_ptr )
{
}
void templateScreenAccelerometer( void *_ptr )
{
}
jj- Posts : 77
Join date : 2008-09-24
Re: Starting with 1.3 template
Hummm looking good to me... maybe try to check tutorial03 to make sure that you are doing the good thing...
Re: Starting with 1.3 template
I went with tutorial11 and got the camera to render, however, it's all grey blocks and it doesn't seem to be using any lights (2 lamps)...
I went back to square one, and think something may not be initalized properly... hmm
Anything I need to do to enable the lighting?
*tried with tutorial03 as well, and there's no shading going on... ?
I went back to square one, and think something may not be initalized properly... hmm
Anything I need to do to enable the lighting?
*tried with tutorial03 as well, and there's no shading going on... ?
jj- Posts : 77
Join date : 2008-09-24
Re: Starting with 1.3 template
Heuuuuuu yeah man... actually maybe you should start by watching ALL the video tutorials... in order to make sure that you grasp everything...
Re: Starting with 1.3 template
I have the same problem with tutorial 12. Every touch or touchMove causes the screen to flicker black. Any solutions to this?
uprise78- Posts : 228
Join date : 2008-10-31
Re: Starting with 1.3 template
It's caused by the new IO system, check like tutorial04 for how the new method works...
Similar topics
» template.xcodeproj revision*
» release template.mm, .h
» Adding a UIViewController to the SIO2 template
» GUIDE: Using sio2 sdk WITHOUT the template project
» Request: glut+SIO2 project template with SIO2 releases.
» release template.mm, .h
» Adding a UIViewController to the SIO2 template
» GUIDE: Using sio2 sdk WITHOUT the template project
» Request: glut+SIO2 project template with SIO2 releases.
Permissions in this forum:
You cannot reply to topics in this forum