0
我想移植到XNA/MonoGame的一些OpenTK(C#Opengl实现)的应用程序,我来到一个缓冲区,但我无法弄清楚如何移植这个,因为似乎没有是任何缓冲功能的直接平等。我想端口验证码:端口OpenGl缓冲区到XNA
public void RefillVBO()
{
if (positions == null) return;
if (hasBuf)
GL.DeleteBuffers(3, buf);
GL.GenBuffers(3, buf);
GL.BindBuffer(BufferTarget.ArrayBuffer, buf[0]);
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(positions.Length * sizeof(float)), positions, BufferUsageHint.StaticDraw);
if (normals != null)
{
GL.BindBuffer(BufferTarget.ArrayBuffer, buf[1]);
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(normals.Length * sizeof(float)), normals, BufferUsageHint.StaticDraw);
}
GL.BindBuffer(BufferTarget.ElementArrayBuffer, buf[2]);
GL.BufferData(BufferTarget.ElementArrayBuffer, (IntPtr)(elementsLength * sizeof(int)), elements, BufferUsageHint.StaticDraw);
hasBuf = true;
}
任何人都可以请翻译这对我来说,可能解释是怎么回事,因为我不知道?
另外,是否有任何移植指南或其他内容,因为字面上有数百个与“G1”函数有关的其他错误。