Example #1
0
 public IndexedBufferView(VertexBuffer vertexes, VertexDefinition vd, string semantic, int usageIndex, IndexBuffer indices, int istride, int icount)
 {
     vertexPter   = (byte *)vertexes.Pin() + vd.OffsetOf(semantic, usageIndex);
     vstride      = vd.Size;
     indicesPter  = (byte *)indices.Pin();
     this.istride = istride;
     this.icount  = icount;
     _indices     = indices;
     _vertexes    = vertexes;
 }
Example #2
0
 public static BufferView Texture0Reader(IntPtr baseAddr, VertexDefinition vd)
 {
     return(new BufferView(baseAddr, vd, VertexSemantic.TextureCoordinate, 0));
 }
Example #3
0
 public static BufferView TangentReader(IntPtr baseAddr, VertexDefinition vd)
 {
     return(new BufferView(baseAddr, vd, VertexSemantic.Tangent, 0));
 }
Example #4
0
 public static BufferView NormalReader(IntPtr baseAddr, VertexDefinition vd)
 {
     return(new BufferView(baseAddr, vd, VertexSemantic.Normal, 0));
 }
Example #5
0
 public static BufferView PositionReader(IntPtr baseAddr, VertexDefinition vd)
 {
     return(new BufferView(baseAddr, vd, VertexSemantic.Position, 0));
 }
Example #6
0
 public BufferView(IntPtr baseAddr, VertexDefinition vd, string semantic, int usageIndex)
 {
     pter   = baseAddr;
     offset = vd.OffsetOf(semantic, usageIndex);
     stride = vd.Size;
 }