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

◆ IndexBuffer() [2/4]

unsafe Microsoft.Xna.Framework.Graphics.IndexBuffer.IndexBuffer ( GraphicsDevice graphicsDevice,
Type indexType,
int indexCount,
BufferUsage usage )
inline

Definition at line 56 of file IndexBuffer.cs.

57 {
58 try
59 {
60 if (indexCount <= 0)
61 {
62 throw new ArgumentOutOfRangeException("indexCount", FrameworkResources.ResourcesMustBeGreaterThanZeroSize);
63 }
64 _parent = graphicsDevice;
65 uint indexSize = (uint)Marshal.SizeOf(indexType);
66 CreateBuffer((uint)indexCount, indexSize, _003CModule_003E.ConvertXnaBufferUsageToDx(usage), (_D3DPOOL)1);
67 graphicsDevice.Resources.AddTrackedObject(this, pComPtr, 1u, _internalHandle, ref _internalHandle);
68 return;
69 }
70 catch
71 {
72 //try-fault
73 base.Dispose(true);
74 throw;
75 }
76 }
unsafe void CreateBuffer(uint indexCount, uint indexSize, uint usage, _D3DPOOL pool)
unsafe IDirect3DIndexBuffer9 * pComPtr
static int SizeOf(object structure)
Definition Marshal.cs:697

References Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.AddTrackedObject(), Microsoft.Xna.Framework.Graphics.IndexBuffer.CreateBuffer(), Microsoft.Xna.Framework.Graphics.IndexBuffer.pComPtr, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources, Microsoft.Xna.Framework.FrameworkResources.ResourcesMustBeGreaterThanZeroSize, and System.Runtime.InteropServices.Marshal.SizeOf().