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

◆ ReleaseNativeObject() [1/2]

virtual unsafe void Microsoft.Xna.Framework.Graphics.Texture2D.ReleaseNativeObject ( [MarshalAs(UnmanagedType.U1)] bool disposeManagedResource)
inlinepackagevirtual

Implements Microsoft.Xna.Framework.Graphics.IGraphicsResource.

Reimplemented in Microsoft.Xna.Framework.Graphics.RenderTarget2D, and Microsoft.Xna.Framework.Graphics.RenderTarget2D.

Definition at line 748 of file Texture2D.cs.

749 {
750 StateTrackerTexture* ptr = pStateTracker;
751 if (ptr != null)
752 {
753 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)ptr + 8)))((nint)ptr);
754 pStateTracker = null;
755 }
756 GraphicsDevice parent = _parent;
757 if (parent != null && pComPtr != null)
758 {
759 parent.Resources.ReleaseAllReferences(_internalHandle, disposeManagedResource);
760 }
761 pComPtr = null;
762 }
unsafe void ReleaseAllReferences(ulong handle, [MarshalAs(UnmanagedType.U1)] bool dispose)
unsafe IDirect3DTexture9 * pComPtr
Definition Texture2D.cs:22
unsafe StateTrackerTexture * pStateTracker
Definition Texture.cs:20

References Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.Texture2D.pComPtr, Microsoft.Xna.Framework.Graphics.Texture.pStateTracker, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.ReleaseAllReferences(), and Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources.

Referenced by Microsoft.Xna.Framework.Graphics.Texture2D._0021Texture2D(), Microsoft.Xna.Framework.Graphics.Texture2D.ReleaseNativeObject(), and Microsoft.Xna.Framework.Graphics.Texture2D.SaveDataForRecreation().