コード例 #1
0
ファイル: OpenGLIndexBuffer.cs プロジェクト: GavinHwa/veldrid
        public void SetIndices <T>(T[] indices, IndexFormat format, int stride, int elementOffset) where T : struct
        {
            int elementSizeInBytes = Unsafe.SizeOf <T>();

            SetData(indices, elementSizeInBytes * indices.Length, elementOffset * elementSizeInBytes);
            ElementsType = OpenGLFormats.MapIndexFormat(format);
        }
コード例 #2
0
        public void SetIndices(IntPtr indices, IndexFormat format, int count, int elementOffset)
        {
            int elementSizeInBytes = format == IndexFormat.UInt16 ? sizeof(ushort) : sizeof(uint);

            SetData(indices, count * elementSizeInBytes, elementOffset * elementSizeInBytes);
            ElementsType = OpenGLFormats.MapIndexFormat(format);
        }
コード例 #3
0
ファイル: OpenGLIndexBuffer.cs プロジェクト: GavinHwa/veldrid
 public void SetIndices(IntPtr indices, IndexFormat format, int elementSizeInBytes, int count, int elementOffset)
 {
     SetData(indices, count * elementSizeInBytes, elementOffset * elementSizeInBytes);
     ElementsType = OpenGLFormats.MapIndexFormat(format);
 }
コード例 #4
0
 public override IndexBuffer CreateIndexBuffer(int sizeInBytes, bool isDynamic, IndexFormat format)
 {
     return(new OpenGLIndexBuffer(isDynamic, OpenGLFormats.MapIndexFormat(format)));
 }