Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReleaseAllDefaultPoolResources()

void Microsoft.Xna.Framework.Graphics.DeviceResourceManager.ReleaseAllDefaultPoolResources ( )
inline

Definition at line 305 of file DeviceResourceManager.cs.

306 {
307 if (pSyncObject == null)
308 {
309 return;
310 }
311 bool lockTaken = false;
312 try
313 {
317 while (enumerator.MoveNext())
318 {
319 ulong current = enumerator.Current;
320 ResourceData resourceData = pResourceData[current];
321 if (resourceData.dwResourceManagementMode == 0)
322 {
324 if (managedObject.IsAlive && managedObject.Target is Effect { isDisposed: false } effect)
325 {
326 effect.OnLostDevice();
327 }
328 else
329 {
330 list.Add(resourceData.objectHandle);
331 }
332 }
333 }
335 while (enumerator2.MoveNext())
336 {
337 ulong current2 = enumerator2.Current;
338 if (pResourceData[current2].CurrentRefCount > 0 && pResourceData[current2].ManagedObject.Target is IGraphicsResource graphicsResource && !pResourceData[current2].isDisposed)
339 {
340 graphicsResource.ReleaseNativeObject(disposeManagedResource: false);
341 }
342 }
343 }
344 finally
345 {
346 if (lockTaken)
347 {
349 }
350 }
351 }
void Add(TKey key, TValue value)
static void Exit(object obj)
static void Enter(object obj)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), System.Collections.Generic.Dictionary< TKey, TValue >.KeyCollection.GetEnumerator(), System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.Collections.Generic.Dictionary< TKey, TValue >.Keys, System.list, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pResourceData, and Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pSyncObject.

Referenced by Microsoft.Xna.Framework.Graphics.GraphicsDevice.Reset().