Can someone help me with a detailed explanation on what to edit if i try to integrate cocos to sio2?
Im still learning though the idea on how things work between those two. THank you in advance.
A fast, easy to use, free, and community supported 2D game engine
Can someone help me with a detailed explanation on what to edit if i try to integrate cocos to sio2?
Im still learning though the idea on how things work between those two. THank you in advance.
Hi, sorry I didn't see this sooner. I have this working on cocos2D 0.8.2 and starting to update to rc 0.99. I should probably write a blog post about it but the technique I used is to call Director -mainLoop from SIO2 but I actually drive the 3D game from cocos2D!
Let me know if you're still interested and I'll post more details.
--yarri
I'm curious what sort of use case made you choose this hybrid approach rather than just modifying sio2 or cocos2d. And do you find it troublesome that Cocos2d is an Obj-C framework and Sio2 is c++ ? What do you choose to do when both engines offer overlapping functionality like gl textures, and gl state etc...?
I'd be very interested to hear more yarri.
We're looking at the possibility of adding 3d animated characters into a cocos2d based game, mainly to get round texture memory limitations, due to the number of character animations quickly building up. So any info/tips/links related would be very very helpful to us, in judging whether this approach could possibly work...
Thanks,
Phil
@CJ - personally I'd prefer to have an ObjC "cocos3D" but there's already a clean separation of gl state in SIO2 that you can leverage; we're mainly using cocos2D for HUD/GUI work.
@PhilM - in the end, either approach hit's the limit of gl hardware but we like the Blender/SIO2 asset pipeline for 3d animation.
I'll post what I have to cocos2d 0.8.2 and maybe someone can help extend this to rc 0.99.
--yarri
oh really? yes. i still wanna learn how to do it please. :)
There are three parts to this solution. One is the changes required to cocos2d, the second is the changes to SIO2 and the third is the design pattern of communication and control between cocos2d and SIO2. I tried to keep the changes required to a minimum, and used a simple function callback control mechanism between cocos2d and SIO2.
Cocos2d Patches
Riq made namespace changes in rc0.99 which helps to integrate cocos2d, but unfortunately this hasn't yet included the Support/EAGLView.m class. Of course SIO2 has it's own EAGLview class, and I chose to keep SIO2 EAGLview class for the app. You then need to refactor cocos2d Director class to accept a new EAGLview. Instead, I made the following changes:
1. Rename cocos2d Support/EAGLView class to ccEAGLView (optionally change the .h/.m file names too)
2. Patch Director.h to accept this new class:
#import "ccTypes.h"
// OpenGL related
#import "Support/ccEAGLView.h" // SIO2
#import "EAGLView.h" // SIO2
3. Patch Director.m to use the EAGLView class, plus make some edits to the following functions:
-(BOOL)initOpenGLViewWithView:(UIView *)view withFrame:(CGRect)rect
{
// SIO2: need to find a way to make this conditional, but let SIO2 initialize the view, we just need a FPS label
FPSLabel = [[LabelAtlas labelAtlasWithString:@"00.0" charMapFile:@"fps_images.png" itemWidth:16 itemHeight:24 startCharMap:'.'] retain];
openGLView_ = view;
return YES;
Update the initOpenGLViewWithView method to accept an SIO2 view, create an optional FPSLabel and return. You could create a new init method of course.
// main loop
//
- (void) mainLoop
{
/* clear window */
// SIO2: don't clear the buffer
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* calculate "global" dt */
[self calculateDeltaTime];
if( ! paused )
[[Scheduler sharedScheduler] tick: dt];
/* to avoid flickr, nextScene MUST be here: after tick and before draw */
if( nextScene )
[self setNextScene];
glPushMatrix();
[self applyLandscape];
// SIO2: don't clear the buffer
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* draw the scene */
[runningScene_ visit];
if( displayFPS )
[self showFPS];
glPopMatrix();
/* swap buffers */
// SIO2: let SIO2 drive the OGLES buffers
//[openGLView_ swapBuffers];
}
Update the mainLoop method to *not* clear or swap the gl buffers, let SIO2 do that.
-(void) end
{
// remove all objects, but don't release it.
// runWithScene might be executed after 'end'.
[scenesStack_ removeAllObjects];
[runningScene_ onExit];
[runningScene_ release];
runningScene_ = nil;
nextScene = nil;
// don't release the event handlers
// They are needed in case the director is run again
[[TouchDispatcher sharedDispatcher] removeAllDelegates];
[self stopAnimation];
// SIO2: don't detach because we don't attach
//[self detach];
}
Update the end method so that cocos2d doesn't detach the view because of course it was never attached.
Note: you may need to patch the convertCoordinats and winSize methods, but in my version of cocos2d they were already updated to use GL_VIEWPORT parameters and not the UIView; check the Google code svn for a patch.
SIO2 Patches
Because we're using the SIO2 EAGLView with cocos2d, we just use the normal SIO2 gl buffer creation process and simply initialize cococ2d. Then within SIO2, within the 2d gl projection, make a call to mainLoop.
First, the patch to SIO2 EAGLView.mm
- (BOOL)createFramebuffer {
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:(CAEAGLLayer*)self.layer];
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, viewRenderbuffer);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth);
glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight);
glGenRenderbuffersOES(1, &depthRenderbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, depthRenderbuffer);
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT16_OES, backingWidth, backingHeight);
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, depthRenderbuffer);
if( !sio2 )
{
// Initialize SIO2 global variable
sio2Init( &tmp_argc, tmp_argv );
// Initialize OpenGL ES
sio2InitGL();
// Initialize OpenAL
sio2InitAL();
// Create a window using the default sio2 structure handle
sio2->_SIO2window = sio2WindowInit();
sio2->_SIO2resource = sio2ResourceInit( "default" );
// Update the viewport with the current window size
sio2WindowUpdateViewport( sio2->_SIO2window, 0, 0, backingWidth, backingHeight );
// Attach a function to the render callback
//sio2->_SIO2window->_SIO2windowrender = templateRender;
sio2->_SIO2window->_SIO2windowrender = templateLoading;
// Specify the function callback to use when the application quit.
sio2WindowShutdown( sio2->_SIO2window, templateShutdown );
// Link the appropriate callbacks to handle tap, move and the
// accelerometer.
sio2->_SIO2window->_SIO2windowtap = templateScreenTap;
sio2->_SIO2window->_SIO2windowtouchmove = templateScreenTouchMove;
sio2->_SIO2window->_SIO2windowaccelerometer = templateScreenAccelerometer;
// Cocos2D initialization
[[Director sharedDirector] setAnimationInterval:1.0f/30];
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[Director sharedDirector] setDisplayFPS:YES];
[[Director sharedDirector] attachInView:self];
[Texture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
[scene addChild: [ccLoadingLayer node]];
[[Director sharedDirector] runWithScene:scene];
[[Director sharedDirector] stopAnimation];
}
return YES;
}
Within the EAGLview createFramebuffer method you simply add a call to attach cocos2d into the SIO2 view. Then you'll need to patch the touchesBegan/Ended methods to pass through touches to cocos2d:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch;
CGPoint pos;
sio2->_SIO2window->n_touch = 0;
for( touch in touches )
{
pos = [ touch locationInView:self ];
sio2->_SIO2window->touch[ sio2->_SIO2window->n_touch ]->x = pos.y;
sio2->_SIO2window->touch[ sio2->_SIO2window->n_touch ]->y = pos.x;
++sio2->_SIO2window->n_touch;
}
sio2->_SIO2window->n_tap = [ [ touches anyObject ] tapCount ];
sio2ResourceDispatchEvents( sio2->_SIO2resource,
sio2->_SIO2window,
SIO2_WINDOW_TAP,
SIO2_WINDOW_TAP_DOWN );
[[TouchDispatcher sharedDispatcher] touchesBegan:touches withEvent:event];
}
And you'll have to repeat this for touchesMoved, touchesEnded.
Note: I also added a cocos2d teardown function to EAGLview, but you could do that explicitly elsewhere.
Next, you'll need to update your SIO2 render functions to call cocos2d. For example, in the SIO2 tutorial template.mm files, you can create a function like this:
void templateRenderCocos2D ( void )
{
// Display loading screen (cocos2D)
sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 1.0f );
{
glEnable(GL_BLEND);
[[Director sharedDirector] mainLoop];
}
// Leave the 2D mode.
sio2WindowLeave2D();
}
This function does nothing more than call the gl matrix and model view, and sets up the SIO2 2D state.
With this function, you can then render your 3D scene with SIO2 as normal and then call this to render the 2D scene, blended, on top of it. You could change the render order if you choose.
Cocos2D Controlling SIO2
This is where it can get tricky: how do you control scene progression? What I chose to do was to have cocos2d control the SIO2 state from within the cocos2d scenes or layers. To do this, I just crated some callback helper functions to change the state. So, for example, when a user clicks on a cocos2d menu button, it triggers a new state within SIO2 causing, say, a new 3d model to load.
You can see some screen shots of the final work on a 3GS iPhone, here:
![]()
http://twitpic.com/12vtja
--yarri
thanks you yarri! nice nice nice. :D
Excellent info yarri, thanks very much!!!
I don't suppose there's a way to have the 3d rendered inbetween cocos2d elements? As in say have background cocos2d layers, a 3d layer, then more cocos2d layers on top? Or with this method, would one always need to be on top of the other?
Sure guys, glad to help. You can always ping me on http://twitter.com/playngive if there are any questions.
@PhilM Sure, you could switch gl projections as you suggest, but that would be a three pass render pipeline which might be expensive. And yes, my technique assumes one on top, but you could render SIO2 on top of cocos2D.
--yarri
Excellent, good to know its feasible. Will have to prototype it to see what fps we can get.
Thanks again for the info.
any downloadable patches?!
@festival Sorry, no. The SIO2 folks aren't too friendly (deleting my posts on their forums, preferring their own "widget" solution, don't like ObjC, etc.) so it will be hard to keep anything in sync. My example works with SIO2 1.4, and I specifically tested against the Tutorial062 code.
--yarri
Hello Yarri... a couple of days headed in the wrong direction (start with COCOS2D template and add SI02 on top of it), I took the SI02 template and worked my way with building, as dependency, COCOS2D and its font library. Another thing that had to be done was to change many files (as needed) to .mm extension since they would only compile if read as Objective-C++ source code.
In some steps I had to deviate because I did not haver a called method (like with ccLoadingLayer below):
[scene addChild: [ccLoadingLayer node]];
I changed that to:
[[CCDirector sharedDirector] runWithScene: [HelloWorld scene]];
(not too important as that only adds a label... so the COCOS2D view has a label and a FPS counter, which works).
COCOS2D works correctly, SI02 sets the rendering context and COCOS2D can render to screen.
This is how I get COCOS2D's content on screen (added in the templateRender function inside template.mm [utility file used in the SI02 template project]):
void templateRenderCocos2D( void )
{
// Display loading screen (cocos2D)
sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 1.0f );
{
glEnable(GL_BLEND);
[[CCDirector sharedDirector] mainLoop];
}
// Leave the 2D mode.
sio2WindowLeave2D();
}
If I leave it like it is, I can see like a frame of my SI02 3D scene before COCOS2D takes over... well at least the Label and the real-time FPS counter look nice... ;).
If I comment out the mainLoop call I get my SI02 powered scene playing out nicely (there's something odd with lighting but it is due to Blender I think... the same exported scene has the same issue inside a standard SI02's SDK example project).
Basically the cocos2D view seems to cover the SI02 one and I have spent quite a few hours trying to get the two views (SI02 and COCOS2D) to actually blend together, but no success... the old make cocos2D background transparent issue? I have looked here for a solution, but either it did not work on my case or I am missing something major that makes it not work... :(.
Hi, you're close. If you're saying that either the SIO2 rendered scene works or the cocos2D scene but not both, then you just need to check your OpenGL clear & mode calls. An OpenGL trace tool can help here.
Double check your glEnable(GL_BLEND) and glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ) calls. It sounds like you are simply drawing and then clearing *twice* which of course is once too many times!
--yarri
Hi Yarri, well they seem to both work but cocos2D layer taking precedence... still when enabling transparency for the Cocos2D layer (as mentioned on this forum in some threads...), the best I get is the background becoming all white (except the label and the FPS counter which are already white by design :P).
I will make a step by step guide later on (starting from the SI02 template)... I had to do many .m to .mm changes and I also integrated some code that mods SI02 a bit further enabling support for 4-bit PVRTC textures (including a change in their exporter script... works beautifully btw).
Some more progress, but I am still far from solving it :(...:
void templateRender( void )
{
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
//glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
if( sio2->_SIO2camera )
{
sio2WindowEnterLandscape3D();
{
sio2CameraRender( sio2->_SIO2camera );
sio2CameraGetModelviewMatrix( sio2->_SIO2camera );
sio2CameraUpdateFrustum( sio2->_SIO2camera );
sio2ResourceCull( sio2->_SIO2resource,
sio2->_SIO2camera );
// Turn ON the mist
//sio2MistRender( _SIO2mist );
{
unsigned int i = 0;
//static float angle = 0.0f;
while( i != sio2->_SIO2resource->n_lamp )
{
// Convert directly the void* to a SIO2lamp handle.
SIO2lamp *_SIO2lamp = ( SIO2lamp * )sio2->_SIO2resource->_SIO2lamp[ i ];
// Set the color to our current lamp
glColor4f( _SIO2lamp->col->x,
_SIO2lamp->col->y,
_SIO2lamp->col->z,
_SIO2lamp->col->w );
// Render a GL_POINT to represent the current position
// of the Lamp in 3D space.
glVertexPointer( 3, GL_FLOAT, 0, ( float * )_SIO2lamp->_SIO2transform->loc );
glDrawArrays( GL_POINTS, 0, 1 );
++i;
}
// Increment the Z angle to have a smooth rotation
//angle += 1.0f;
sio2LampEnableLight();
bulletUpdate();
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT | SIO2_RENDER_LAMP );
sio2MaterialReset();
// Turn OFF the lights.
sio2LampResetLight();
}
// Turn off the mist.
sio2MistReset();
}
sio2WindowLeaveLandscape3D();
templateRenderCocos2D();
}
}
This code will show Cocos2D correctly overlapping the SI02 view, but the SI02 view will not be animated (the fps counter gets updated correctly, but the 3D scene underneath stays still).
If I uncomment glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ); at the top of the function... and then I comment templateRenderCocos2D(); out I can see the SI02 scene correctly animated, but if I do not comment the cocos2D rendering code out I will only see a black background with cocos2D FPS counter on...
Other oddities (leaving the glClear function commented out as mentioned in my previous post... so I still have the problem of the 3D scene apparently not animating as if cocos2D were overlapping only SI02's first produced frame)... I had the label created at init time disabled (the HelloWorld one):
// Cocos2D initialization
[[CCDirector sharedDirector] setAnimationInterval:1.0f/30];
[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[CCDirector sharedDirector] setDisplayFPS:YES];
[[CCDirector sharedDirector] attachInView:self]; //re-nable
[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
[[CCDirector sharedDirector] runWithScene: [HelloWorld scene]]; //re-enable
[[CCDirector sharedDirector] stopAnimation];
... and the code for the actual label:
// create and initialize a Label
CCLabel* label = [CCLabel labelWithString:@"Hello World_Mark!!!" fontName:@"Marker Felt" fontSize:64];
// ask director the the window size
CGSize size = [[CCDirector sharedDirector] winSize];
//position the label on the center of the screen
label.position = ccp( size.width /2 , size.height/2 );
//add the label as a child to this Layer
[self addChild: label];
and just left the FPS counter on (visible)... if I re-enable the label then the glEnable(GL_BLEND); before the cocos2D mainLoop call becomes very important...
void templateRenderCocos2D( void )
{
// Display loading screen (cocos2D)
sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 1.0f );
{
glEnable(GL_BLEND);
[[CCDirector sharedDirector] mainLoop];
}
// Leave the 2D mode.
sio2WindowLeave2D();
}
Now... if I comment the glEnable(GL_BLEND); command out then the FPS counter is correctly displayed while there's a completely white rectangular strip where the label should be.
If I leave the glEnable(GL_BLEND); command in place (inside the templateRenderCocos2() function) then I can see the HelloWorld label correctly blended with (the first frame of) the SI02 scene, but then I have a problem with the FPS label... it's as if that element never gets cleared and you get to see the FPS counter being drawn over itself (so you do not get the effect of the digits cleanly changing, but more of a visual mess...)
If I restore the glClear command:
void templateRender( void )
{
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
//glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
The FPS label animates correctly (previous buffer being cleared), but I do not get to see the SI02 view (same problem as I mentioned above... it gets quickly erased with the cocos2D view taking over)...
Downloaded a trial version of gDEBugger and activated the in depth mode and did a pause in the simulation debugging right after the cocos2D elements take over and the SI02 image "disappears"... I do not see any redundant glClear call there... I also do not see any glEnable(GL_BLEND) either... although in my code they are there... :(...
I do not know my code's problems... I just know it has some somewhere... :(.
Still close but no cigar... at least I solved the 3D issue with the SI02 sample I was working on... I would really like to get this SI02-cocos2D integration going though... :(.
I tried about above posts
and I still don't know how to do it...
please someone link to me template files.. or archive.
help me please...
thanks.
Hi, sounds like you were close with the FPS label not clearing correctly but your HelloWorld label showing? One thing that stands out is your use of *_RGBA8888 format for CCTexture2D. I used kRGB565 which is the old Director default value.
Other than that, it's hard to give advice without seeing more detail -- screenshots, etc.
Good luck,
--yarri
Hello Yarri,
I have been working on completely SIO2 unrelated things in the past few days (PDF creation) so I could not answer earlier on :(.
"One thing that stands out is your use of *_RGBA8888 format for CCTexture2D. I used kRGB565 which is the old Director default value."
That's strange because it comes from your instructions... :(... the only thing I changed from your changes was the ccLoadingLayer which turned into the [HelloWorld scene] bit to add the HelloWorld label.
[Texture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
became
[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
because Texture2D does not seem to be valid while CCTexture2D seems correct (no compilation issues).
I'll upload everything on Google Code tomorrow morning (or earlier if I can). I'll make some screenshots too.
Edit: here are the screenshots (I have tried your suggested texture format RGB565 too).
The following code:
void templateRenderCocos2D( void )
{
// Display loading screen (cocos2D)
sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 1.0f );
{
//glEnable(GL_BLEND);
[[CCDirector sharedDirector] mainLoop];
//glDisable(GL_BLEND);
}
// Leave the 2D mode.
sio2WindowLeave2D();
}
produces: http://farm5.static.flickr.com/4033/4444287400_c22f6a9dc3_o.png
void templateRenderCocos2D( void )
{
// Display loading screen (cocos2D)
sio2WindowEnter2D( sio2->_SIO2window, 0.0f, 1.0f );
{
glEnable(GL_BLEND);
[[CCDirector sharedDirector] mainLoop];
//glDisable(GL_BLEND);
}
// Leave the 2D mode.
sio2WindowLeave2D();
}
produces: http://farm5.static.flickr.com/4062/4444287548_eacc32cdea_o.png
void templateRender( void )
{
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
if( !refresh_thread )
{ refresh_thread = 1; }
CMLog ([SysTools UIntToString:[[sio2Self getDelegate] online]]);
if ([[sio2Self getDelegate] online] == NO) { return; }
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
//glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
if( sio2->_SIO2camera )
{
sio2WindowEnterLandscape3D();
{
sio2CameraRender( sio2->_SIO2camera );
sio2CameraGetModelviewMatrix( sio2->_SIO2camera );
sio2CameraUpdateFrustum( sio2->_SIO2camera );
sio2ResourceCull( sio2->_SIO2resource,
sio2->_SIO2camera );
// Turn ON the mist
//sio2MistRender( _SIO2mist );
{
unsigned int i = 0;
//static float angle = 0.0f;
while( i != sio2->_SIO2resource->n_lamp )
{
// Convert directly the void* to a SIO2lamp handle.
SIO2lamp *_SIO2lamp = ( SIO2lamp * )sio2->_SIO2resource->_SIO2lamp[ i ];
// Set the color to our current lamp
glColor4f( _SIO2lamp->col->x,
_SIO2lamp->col->y,
_SIO2lamp->col->z,
_SIO2lamp->col->w );
// Render a GL_POINT to represent the current position
// of the Lamp in 3D space.
glVertexPointer( 3, GL_FLOAT, 0, ( float * )_SIO2lamp->_SIO2transform->loc );
glDrawArrays( GL_POINTS, 0, 1 );
++i;
}
// Increment the Z angle to have a smooth rotation
//angle += 1.0f;
sio2LampEnableLight();
bulletUpdate();
sio2ResourceRender( sio2->_SIO2resource,
sio2->_SIO2window,
sio2->_SIO2camera,
SIO2_RENDER_SOLID_OBJECT | SIO2_RENDER_LAMP );
sio2MaterialReset();
// Turn OFF the lights.
sio2LampResetLight();
}
// Turn off the mist.
sio2MistReset();
}
sio2WindowLeaveLandscape3D();
templateRenderCocos2D();
}
}Hi, can you also post what is displayed if you don't call templateRenderCocos2D()?
--yarri
If you comment the templateRenderCocos2D call out, you see the sio2 powered 3D scene: http://farm3.static.flickr.com/2794/4445344926_7defc04eea_o.png
Two things... 1.) I am using a small patch found on the sio2 forums that adds PVRTC exporting support to the python exporter for Blender and enable PVRTC support in sio2 when textures are loaded from the .sio2 file. 2.) With the current camera FOV, the camera origin is so far from the actual scene that you can see some horrible mip-map banding very close to the "screen" :(...
http://code.google.com/p/si02-r-n-d/source/browse/#svn/branches/0.1/RnD_01_rolling_spheres
Sorry for the delay, I wanted to try to separate everything into tiny libs. Now, making a template should be easier!
http://farm3.static.flickr.com/2726/4444875871_30002ba2c1_o.png
http://farm3.static.flickr.com/2767/4444875813_93fb212c2b_o.png
(I really just created a target for each item [static lib] and re-added the relevant src files folders one by one making sure to check which target they were added to... deleted some references like sio2wrap and the swig folder in the lua folder, changed the source file type for all sio2's files to Objective-C++ ... sourcecode.cpp.objcpp, linked the created libraries against the related targets, etc...)
Hi, I'll check out the code later today but if you're seeing each scene correctly individually, I think you just have an extra glClear() call.
--yarri
You must log in to post.