Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions starling/src/starling/core/Starling.as
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ package starling.core
private static var sCurrent:Starling;
private static var sHandleLostContext:Boolean;
private static var sContextData:Dictionary = new Dictionary(true);
private static var sAll:Vector.<Starling> = new <Starling>[];

// construction

Expand Down Expand Up @@ -274,6 +275,8 @@ package starling.core
// for context data, we actually reference by stage3D, since it survives a context loss
sContextData[stage3D] = new Dictionary();
sContextData[stage3D][PROGRAM_DATA_NAME] = new Dictionary();

sAll.push(this);

// all other modes are problematic in Starling, so we force those here
stage.scaleMode = StageScaleMode.NO_SCALE;
Expand Down Expand Up @@ -344,6 +347,12 @@ package starling.core
if (disposeContext3D.length == 1) disposeContext3D(false);
else disposeContext3D();
}

var index:int = sAll.indexOf(this);
if(index != -1)
{
sAll.splice(index, 1);
}
}

// functions
Expand Down Expand Up @@ -1058,5 +1067,11 @@ package starling.core
else
sHandleLostContext = value;
}

/** All Starling instances. <p>CAUTION: not a copy, but the actual object! Do not modify!</p> */
public static function get all():Vector.<Starling>
{
return sAll;
}
}
}