Exemplo n.º 1
0
 private void EnsureVBOSize(int size, bool copyonresize = true)
 {
     if (size > _vbo.BufferSize)
     {
         _vbo.SetSize(size * 2, BufferUsageHint.DynamicDraw, copyonresize);
     }
 }
Exemplo n.º 2
0
 private void EnsureIBOSize(int size)
 {
     if (size > _ibo.BufferSize)
     {
         _ibo.SetSize(size * 2, BufferUsageHint.DynamicDraw);
     }
 }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 public WellRenderer()
 {
     _vbo = new GLBuffer <GenericVertex>(BufferTarget.ArrayBuffer);
     _vbo.Bind();
     _vbo.SetSize(
         LineRenderer.StartingLineCount * wellsize,
         BufferUsageHint.DynamicDraw);
     _vbo.Unbind();
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
        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();
        }