コード例 #1
0
        public void SetData <T>(
            int offsetInBytes,
            T[] data,
            int startIndex,
            int elementCount,
            int vertexStride,
            SetDataOptions options
            ) where T : struct
        {
            ErrorCheck(data, startIndex, elementCount, vertexStride);

            int      elementSizeInBytes = Marshal.SizeOf(typeof(T));
            GCHandle handle             = GCHandle.Alloc(data, GCHandleType.Pinned);

            FNA3D.FNA3D_SetVertexBufferData(
                GraphicsDevice.GLDevice,
                buffer,
                offsetInBytes,
                handle.AddrOfPinnedObject() + (startIndex * elementSizeInBytes),
                elementCount,
                elementSizeInBytes,
                vertexStride,
                options
                );
            handle.Free();
        }
コード例 #2
0
 public void SetDataPointerEXT(
     int offsetInBytes,
     IntPtr data,
     int dataLength,
     SetDataOptions options
     )
 {
     FNA3D.FNA3D_SetVertexBufferData(
         GraphicsDevice.GLDevice,
         buffer,
         offsetInBytes,
         data,
         dataLength,
         1,
         1,
         options
         );
 }