コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: VertexIndexData.cs プロジェクト: axiom3d/axiom
 public VertexData(HardwareBufferManagerBase mgr)
     : base()
 {
     this._mgr = mgr != null ? mgr : HardwareBufferManager.Instance;
     this.vertexBufferBinding = HardwareBufferManager.Instance.CreateVertexBufferBinding();
     this.vertexDeclaration   = HardwareBufferManager.Instance.CreateVertexDeclaration();
     DeleteDclBinding         = true;
 }
コード例 #3
0
ファイル: VertexIndexData.cs プロジェクト: axiom3d/axiom
 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;
 }
コード例 #4
0
 protected internal HardwareBufferManager(HardwareBufferManagerBase baseInstance)
     : base()
 {
     if (instance == null)
     {
         instance           = this;
         this._baseInstance = baseInstance;
     }
 }
コード例 #5
0
        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;
        }
コード例 #6
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];
 }
コード例 #7
0
 /// <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];
 }
コード例 #8
0
 public SoftwareBufferManager(HardwareBufferManagerBase baseInstance) : base(baseInstance)
 {
 }
コード例 #9
0
 /// <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];
 }
コード例 #10
0
 public DefaultHardwareIndexBuffer(HardwareBufferManagerBase manager, IndexType idxType, int numIndexes,
                                   BufferUsage usage)
     : base(manager, idxType, numIndexes, usage, true, false)
 {
     _mpData = new byte[sizeInBytes];
 }