Tag: vbo

VBO在C#中使用交错顶点

我正在尝试使用VBO使用OpenTK在C#中绘制我的模型。 在我的在线研究中,我在许多地方读过,优先考虑使交错数据结构的大小为32字节的精确倍数,因此我编写了以下代码: [Serializable] [StructLayout(LayoutKind.Sequential)] public struct Byte4 { public byte R, G, B, A; public Byte4(byte[] input) { R = input[0]; G = input[1]; B = input[2]; A = input[3]; } public uint ToUInt32() { byte[] temp = new byte[] { this.R, this.G, this.B, this.A }; return BitConverter.ToUInt32(temp, 0); } } [Serializable] [StructLayout(LayoutKind.Sequential)] public struct […]