private void EnsureVBOSize(int size, bool copyonresize = true) { if (size > _vbo.BufferSize) { _vbo.SetSize(size * 2, BufferUsageHint.DynamicDraw, copyonresize); } }
private void EnsureIBOSize(int size) { if (size > _ibo.BufferSize) { _ibo.SetSize(size * 2, BufferUsageHint.DynamicDraw); } }
private void EnsureIBOSize(int size, bool copyonresize = true) { if (size > _accelibo.BufferSize) { // double the buffer size. this is expensive, so avoid doing it // as much as possible _accelibo.SetSize(size * 2, BufferUsageHint.DynamicDraw, copyonresize); } }
public WellRenderer() { _vbo = new GLBuffer <GenericVertex>(BufferTarget.ArrayBuffer); _vbo.Bind(); _vbo.SetSize( LineRenderer.StartingLineCount * wellsize, BufferUsageHint.DynamicDraw); _vbo.Unbind(); }
private void EnsureIBOSize(int size) { if (size > _ibo.BufferSize) { // double the buffer size. this is expensive, so avoid doing it // as much as possible _ibo.SetSize(size * 2, BufferUsageHint.DynamicDraw); } }
public LineAccelRenderer() { _accelbuffer = new GLBuffer <GenericVertex>(BufferTarget.ArrayBuffer); _accelbuffer.Bind(); _accelbuffer.SetSize((LineRenderer.StartingLineCount / 2) * 3, BufferUsageHint.DynamicDraw, false); _accelbuffer.Unbind(); _accelibo = new GLBuffer <int>(BufferTarget.ElementArrayBuffer); _accelibo.Bind(); _accelibo.SetSize((LineRenderer.StartingLineCount / 2) * 3, BufferUsageHint.DynamicDraw, false); _accelibo.Unbind(); }
public LineRenderer(Shader sh) { if (sh == null) { throw new ArgumentNullException("shader"); } _shader = sh; _vbo = new GLBuffer <LineVertex>(BufferTarget.ArrayBuffer); _ibo = new GLBuffer <int>(BufferTarget.ElementArrayBuffer); _vbo.Bind(); _vbo.SetSize(StartingLineCount * linesize, BufferUsageHint.DynamicDraw); _vbo.Unbind(); _ibo.Bind(); _ibo.SetSize(StartingLineCount * linesize, BufferUsageHint.DynamicDraw); _ibo.Unbind(); }