public static void SetVertexArray(VertexArray varray) { if (curVarray != null && varray.id != curVarray.id) { GPUStateMachine.UnbindVertexArray(); } curVarray = varray; }
public void SetBufferObject(int index, GPUBuffer buffer, int elementCount, VertexAttribPointerType type) { GPUStateMachine.BindVertexArray(id); GL.EnableVertexAttribArray(index); GPUStateMachine.BindBuffer(buffer.target, buffer.id); GL.VertexAttribPointer(index, elementCount, type, false, 0, 0); GPUStateMachine.UnbindBuffer(buffer.target); GPUStateMachine.UnbindVertexArray(); }