private BufferSubData ( |
||
target | ||
offset | ||
size | ||
data | void | |
리턴 | void |
//glMapBuffer <<< NOTE: This method is slower, only use if have to //glUnmapBuffer public unsafe override void Update(int[] indices, int updateCount) { GL.BindBuffer(GL.ELEMENT_ARRAY_BUFFER, indexBuffer); if (_32BitIndices) { fixed(int *indicesPtr = indices) { IntPtr bufferSize = new IntPtr(indexByteSize * updateCount); GL.BufferSubData(GL.ELEMENT_ARRAY_BUFFER, IntPtr.Zero, bufferSize, indicesPtr); } } else { var indices16Bit = new short[updateCount]; for (int i = 0; i != updateCount; ++i) { indices16Bit[i] = (short)indices[i]; } fixed(short *indicesPtr = indices16Bit) { IntPtr bufferSize = new IntPtr(indexByteSize * updateCount); GL.BufferSubData(GL.ELEMENT_ARRAY_BUFFER, IntPtr.Zero, bufferSize, indicesPtr); } } #if DEBUG Video.checkForError(); #endif }
public unsafe override void Update(float[] vertices, int updateCount) { GL.BindBuffer(GL.ARRAY_BUFFER, vertexBuffer); fixed(float *verticesPtr = vertices) { IntPtr bufferSize = new IntPtr(vertexByteSize * updateCount); GL.BufferSubData(GL.ARRAY_BUFFER, IntPtr.Zero, bufferSize, verticesPtr); } #if DEBUG Video.checkForError(); #endif }