예제 #1
0
파일: RawMesh.cs 프로젝트: iceklue/Integral
        private static void BindIndicesBuffer(int[] indices)
        {
            int vboID = 0;

            GL.GenBuffers(1, out vboID);
            vbos.Add(vboID);
            GL.BindBuffer(BufferTarget.ElementArrayBuffer, vboID);
            GL.BufferData(BufferTarget.ElementArrayBuffer, sizeof(int) * indices.Length, indices, BufferUsageHint.StaticDraw);
        }
예제 #2
0
파일: RawMesh.cs 프로젝트: iceklue/Integral
        private static void StoreDataInAttributeList(int attributeIndex, int size, float[] data)
        {
            int vboID = 0;

            GL.GenBuffers(1, out vboID);
            vbos.Add(vboID);
            GL.BindBuffer(BufferTarget.ArrayBuffer, vboID);
            GL.BufferData(BufferTarget.ArrayBuffer, sizeof(float) * data.Length, data, BufferUsageHint.StaticDraw);
            GL.VertexAttribPointer(attributeIndex, size, VertexAttribPointerType.Float, false, 0, 0);
            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
        }