Ejemplo n.º 1
0
        // New items

        /// <summary> Make a new entry of this type with an optional name </summary>
        public GLVertexArray NewArray(string name = null)
        {
            GLVertexArray b = new GLVertexArray();

            items[EnsureName(name)] = b;
            return(b);
        }
Ejemplo n.º 2
0
        /// <summary> Make a new entry of this type with an optional name </summary>
        public GLVertexArray NewVertexArray(string name = null)
        {
            var b = new GLVertexArray();        // a standard buffer returned is not for uniforms do not suffer the std140 restrictions

            items[EnsureName(name)] = b;
            return(b);
        }
Ejemplo n.º 3
0
 /// <summary>Bind buffer to vertext array at this bindingindex, with the start position stride and divisor</summary>
 public void Bind(GLVertexArray va, int bindingindex, int start, int stride, int divisor = 0) // set buffer binding to a VA
 {
     System.Diagnostics.Debug.Assert(context == GLStatics.GetContext(), "Context incorrect"); // safety
     System.Diagnostics.Debug.Assert(mapmode == MapMode.None);                                // catch unmap missing. Since binding to VA can be done before buffer is full, then don't check BufferSize
     va.Bind();
     GL.BindVertexBuffer(bindingindex, Id, (IntPtr)start, stride);                            // this buffer to binding index
     GL.VertexBindingDivisor(bindingindex, divisor);
     GLStatics.Check();
     //System.Diagnostics.Debug.WriteLine("BUFBIND " + bindingindex + " To B" + Id + " pos " + start + " stride " + stride + " divisor " + divisor);
 }
Ejemplo n.º 4
0
 /// <summary> Add this type with an optional name </summary>
 public GLVertexArray Add(GLVertexArray disp, string name = null)
 {
     System.Diagnostics.Debug.Assert(!items.ContainsValue(disp));
     items.Add(EnsureName(name), disp);
     return(disp);
 }