public HardwareIndexBuffer(HardwareBufferManagerBase manager, IndexType type, int numIndices, BufferUsage usage, bool useSystemMemory, bool useShadowBuffer) : base(usage, useSystemMemory, useShadowBuffer) { this.type = type; this.numIndices = numIndices; this.Manager = manager; // calc the index buffer size sizeInBytes = numIndices; if (type == IndexType.Size32) { this.indexSize = Memory.SizeOf(typeof(int)); } else { this.indexSize = Memory.SizeOf(typeof(short)); } sizeInBytes *= this.indexSize; // create a shadow buffer if required if (useShadowBuffer) { shadowBuffer = new DefaultHardwareIndexBuffer(this.Manager, type, numIndices, BufferUsage.Dynamic); } }
public VertexData(HardwareBufferManagerBase mgr) : base() { this._mgr = mgr != null ? mgr : HardwareBufferManager.Instance; this.vertexBufferBinding = HardwareBufferManager.Instance.CreateVertexBufferBinding(); this.vertexDeclaration = HardwareBufferManager.Instance.CreateVertexDeclaration(); DeleteDclBinding = true; }
public VertexData(VertexDeclaration dcl, VertexBufferBinding bind) : base() { // this is a fallback rather than actively used this._mgr = HardwareBufferManager.Instance; this.vertexDeclaration = dcl; this.vertexBufferBinding = bind; DeleteDclBinding = false; }
protected internal HardwareBufferManager(HardwareBufferManagerBase baseInstance) : base() { if (instance == null) { instance = this; this._baseInstance = baseInstance; } }
public HardwareVertexBuffer(HardwareBufferManagerBase manager, VertexDeclaration vertexDeclaration, int numVertices, BufferUsage usage, bool useSystemMemory, bool useShadowBuffer) : base(usage, useSystemMemory, useShadowBuffer) { this.vertexDeclaration = vertexDeclaration; this.numVertices = numVertices; this.Manager = manager; // calculate the size in bytes of this buffer sizeInBytes = vertexDeclaration.GetVertexSize() * numVertices; // create a shadow buffer if required if (useShadowBuffer) { shadowBuffer = new DefaultHardwareVertexBuffer(this.Manager, vertexDeclaration, numVertices, BufferUsage.Dynamic); } this.useCount = 0; }
public DefaultHardwareVertexBuffer(HardwareBufferManagerBase manager, VertexDeclaration vertexDeclaration, int numVertices, BufferUsage usage) : base(manager, vertexDeclaration, numVertices, usage, true, false) // always software, never shadowed { _mpData = new byte[base.sizeInBytes]; }
/// <summary> /// /// </summary> /// <remarks> /// This is already in system memory, so no need to use a shadow buffer. /// </remarks> /// <param name="vertexSize"></param> /// <param name="numVertices"></param> /// <param name="usage"></param> public SoftwareVertexBuffer(HardwareBufferManagerBase manager, VertexDeclaration vertexDeclaration, int numVertices, BufferUsage usage) : base(manager, vertexDeclaration, numVertices, usage, true, false) { data = new byte[sizeInBytes]; }
public SoftwareBufferManager(HardwareBufferManagerBase baseInstance) : base(baseInstance) { }
/// <summary> /// /// </summary> /// <remarks> /// This is already in system memory, so no need to use a shadow buffer. /// </remarks> /// <param name="vertexSize"></param> /// <param name="numVertices"></param> /// <param name="usage"></param> public SoftwareIndexBuffer(HardwareBufferManagerBase manager, IndexType type, int numIndices, BufferUsage usage) : base(manager, type, numIndices, usage, true, false) { data = new byte[sizeInBytes]; }
public DefaultHardwareIndexBuffer(HardwareBufferManagerBase manager, IndexType idxType, int numIndexes, BufferUsage usage) : base(manager, idxType, numIndexes, usage, true, false) { _mpData = new byte[sizeInBytes]; }