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

◆ InitializeDescription() [2/2]

unsafe void Microsoft.Xna.Framework.Graphics.Texture3D.InitializeDescription ( SurfaceFormat? format)
inlineprivate

Definition at line 26 of file Texture3D.cs.

27 {
28 IntPtr intPtr = (IntPtr)pComPtr;
29 Helpers.CheckDisposed(this, intPtr);
30 IDirect3DVolumeTexture9* ptr = pComPtr;
31 System.Runtime.CompilerServices.Unsafe.SkipInit(out _D3DVOLUME_DESC d3DVOLUME_DESC);
32 int num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint, _D3DVOLUME_DESC*, int>)(int)(*(uint*)(*(int*)ptr + 68)))((nint)ptr, 0u, &d3DVOLUME_DESC);
33 if (num < 0)
34 {
35 throw GraphicsHelpers.GetExceptionFromResult((uint)num);
36 }
37 if (!format.HasValue)
38 {
39 format = _003CModule_003E.ConvertWindowsFormatToXna(*(_D3DFORMAT*)(&d3DVOLUME_DESC));
40 }
41 _width = System.Runtime.CompilerServices.Unsafe.As<_D3DVOLUME_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DVOLUME_DESC, 16));
42 _height = System.Runtime.CompilerServices.Unsafe.As<_D3DVOLUME_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DVOLUME_DESC, 20));
43 _depth = System.Runtime.CompilerServices.Unsafe.As<_D3DVOLUME_DESC, int>(ref System.Runtime.CompilerServices.Unsafe.AddByteOffset(ref d3DVOLUME_DESC, 24));
44 base.InitializeDescription(format.Value);
45 }
unsafe IDirect3DVolumeTexture9 * pComPtr
Definition Texture3D.cs:18

References Microsoft.Xna.Framework.Graphics.Texture3D._depth, Microsoft.Xna.Framework.Graphics.Texture3D._height, Microsoft.Xna.Framework.Graphics.Texture3D._width, Microsoft.Xna.Framework.Helpers.CheckDisposed(), System.format, Microsoft.Xna.Framework.Graphics.GraphicsHelpers.GetExceptionFromResult(), and Microsoft.Xna.Framework.Graphics.Texture3D.pComPtr.

Referenced by Microsoft.Xna.Framework.Graphics.Texture3D.Texture3D(), Microsoft.Xna.Framework.Graphics.Texture3D.CreateTexture(), and Microsoft.Xna.Framework.Graphics.Texture3D.OnObjectCreation().