void Init::shareContext(RegalSystemContext a, RegalSystemContext b) { init(); RegalContext *contextA = getContext(a); RegalContext *contextB = getContext(b); RegalAssert(contextA); RegalAssert(contextB); // Either of the groups of contexts needs to be uninitialized. // In principle Regal might be able to merge the shared // containers together, but that's not currently implemented. if (contextA->groupInitializedContext() && contextB->groupInitializedContext()) { Warning("Regal can't share initialized context groups."); RegalAssert(false); return; } // Share all the Regal contexts in b into a std::list<RegalContext *> tmp = *contextB->shareGroup; for (std::list<RegalContext *>::iterator i = tmp.begin(); i!=tmp.end(); ++i) { RegalAssert(*i); contextA->shareGroup->push_back(*i); (*i)->shareGroup = contextA->shareGroup; } }
void TexC::Init( RegalContext& ctx ) { RegalContext* sharingWith = ctx.groupInitializedContext(); if ( sharingWith != NULL ) { mapTextureToTextureState = sharingWith->texc->mapTextureToTextureState; } Reset_(); }