Closed triki999 closed 10 years ago
I think this is something for @jonathanrpace , he did a re-write of this some time ago.
I feel very unsure of what to do, so I hope he can shed some light on this :)
Oh dear - god knows why I'm decrementing that value and not re-assigning it back to the value in the table . . .
Your fix for decrementing the table reference is correct. However you shouldn't need to call 'flush()' afterwards (you can see that flush() is called only when trying to increase the number of program3D's past a certain limit).
If it works without the flush(), and the examples still run ok after a context switch - send us over a merge request.
Doesn't work without flush() I think that a new Program3D has to be recreated from the current context.
I am closing this, see Issue #100
Hi. I don't know what exactly is going on but i have a problem when switching contexts and i lose all graphic data. I found a way to resolve the issue but i don't know if is ok.
starling.display.materials.Program3DCache
public static function releaseProgram3D( program3D:Program3D ):void { if ( !numReferencesByProgramTable[program3D] ) { throw( new Error( "Program3D is not in cache" ) ); return; } numReferencesByProgramTable[program3D]--; flush();