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

◆ VertexBuffer() [4/4]

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

Definition at line 82 of file VertexBuffer.cs.

83 {
84 try
85 {
86 if (vertexDeclaration == null)
87 {
88 throw new ArgumentNullException("vertexDeclaration", FrameworkResources.NullNotAllowed);
89 }
90 if (vertexCount <= 0)
91 {
92 throw new ArgumentOutOfRangeException("vertexCount", FrameworkResources.ResourcesMustBeGreaterThanZeroSize);
93 }
94 _parent = graphicsDevice;
95 CreateBuffer(vertexDeclaration, (uint)vertexCount, _003CModule_003E.ConvertXnaBufferUsageToDx(usage), (_D3DPOOL)1);
96 graphicsDevice.Resources.AddTrackedObject(this, pComPtr, 1u, _internalHandle, ref _internalHandle);
97 return;
98 }
99 catch
100 {
101 //try-fault
102 base.Dispose(true);
103 throw;
104 }
105 }
unsafe IDirect3DVertexBuffer9 * pComPtr
unsafe void CreateBuffer(VertexDeclaration vertexDeclaration, uint dwVertexCount, uint usage, _D3DPOOL pool)

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.FrameworkResources.NullNotAllowed, Microsoft.Xna.Framework.Graphics.VertexBuffer.pComPtr, Microsoft.Xna.Framework.Graphics.GraphicsDevice.Resources, and Microsoft.Xna.Framework.FrameworkResources.ResourcesMustBeGreaterThanZeroSize.