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

◆ GetManagedObject()

static unsafe Texture2D Microsoft.Xna.Framework.Graphics.Texture2D.GetManagedObject ( IDirect3DTexture9 * pInterface,
GraphicsDevice pDevice,
uint pool )
inlinestaticpackage

Definition at line 902 of file Texture2D.cs.

903 {
904 Texture2D texture2D = pDevice.Resources.GetCachedObject(pInterface) as Texture2D;
905 if (texture2D != null)
906 {
907 ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)pInterface + 8)))((nint)pInterface);
908 texture2D.isDisposed = false;
909 GC.ReRegisterForFinalize(texture2D);
910 }
911 else
912 {
913 texture2D = new Texture2D(pInterface, pDevice);
914 pDevice.Resources.AddTrackedObject(texture2D, pInterface, pool, 0uL, ref texture2D._internalHandle);
915 }
916 return texture2D;
917 }
static void ReRegisterForFinalize(object obj)
Definition GC.cs:214
Definition GC.cs:8

References Microsoft.Xna.Framework.Graphics.Texture2D.Texture2D(), Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.AddTrackedObject(), Microsoft.Xna.Framework.Graphics.DeviceResourceManager.GetCachedObject(), System.GC.ReRegisterForFinalize(), and Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources.

Referenced by Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueTexture2D().