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

◆ VertexBuffer() [3/4]

unsafe Microsoft.Xna.Framework.Graphics.VertexBuffer.VertexBuffer ( GraphicsDevice graphicsDevice,
Type vertexType,
int vertexCount,
BufferUsage usage )
inline

Definition at line 60 of file VertexBuffer.cs.

61 {
62 try
63 {
64 VertexDeclaration vertexDeclaration = VertexDeclaration.FromType(vertexType);
65 if (vertexCount <= 0)
66 {
67 throw new ArgumentOutOfRangeException("vertexCount", FrameworkResources.ResourcesMustBeGreaterThanZeroSize);
68 }
69 _parent = graphicsDevice;
70 CreateBuffer(vertexDeclaration, (uint)vertexCount, _003CModule_003E.ConvertXnaBufferUsageToDx(usage), (_D3DPOOL)1);
71 graphicsDevice.Resources.AddTrackedObject(this, pComPtr, 1u, _internalHandle, ref _internalHandle);
72 return;
73 }
74 catch
75 {
76 //try-fault
77 base.Dispose(true);
78 throw;
79 }
80 }
unsafe IDirect3DVertexBuffer9 * pComPtr
unsafe void CreateBuffer(VertexDeclaration vertexDeclaration, uint dwVertexCount, uint usage, _D3DPOOL pool)
static VertexDeclaration FromType(Type vertexType)

References Microsoft.Xna.Framework.Graphics.GraphicsResource._internalHandle, Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.AddTrackedObject(), Microsoft.Xna.Framework.Graphics.VertexBuffer.CreateBuffer(), Microsoft.Xna.Framework.Graphics.VertexDeclaration.FromType(), Microsoft.Xna.Framework.Graphics.VertexBuffer.pComPtr, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources, and Microsoft.Xna.Framework.FrameworkResources.ResourcesMustBeGreaterThanZeroSize.