public void EnableAttrib( VboPosition id, int attribArrayIdx = -1, VertexAttribPointerType type = VertexAttribPointerType.Float, bool normalized = false, int stride = 0, int offset = 0) { if (attribArrayIdx < 0) attribArrayIdx = (int)id; VboBase vboBase = this[id]; GL.BindVertexArray(Handle); vboBase.Bind(); GL.EnableVertexAttribArray(attribArrayIdx); GL.VertexAttribPointer(attribArrayIdx, vboBase.ElementSize, type, normalized, stride, offset); //GL.BindVertexArray(0); //VboBase.Unbind(); }
public void EnableAttribI( VboPosition id, int attribArrayIdx = -1, VertexAttribIntegerType type = VertexAttribIntegerType.Int, int stride = 0, int offset = 0) { if (attribArrayIdx < 0) { attribArrayIdx = (int)id; } VboBase vboBase = this[id]; GL.BindVertexArray(Handle); vboBase.Bind(); GL.EnableVertexAttribArray(attribArrayIdx); GL.VertexAttribIPointer(attribArrayIdx, vboBase.ElementSize, type, stride, new IntPtr(offset)); //GL.BindVertexArray(0); //VboBase.Unbind(); }
public void EnableAttrib( VboPosition id, int attribArrayIdx = -1, VertexAttribPointerType type = VertexAttribPointerType.Float, bool normalized = false, int stride = 0, int offset = 0) { if (attribArrayIdx < 0) { attribArrayIdx = (int)id; } VboBase vboBase = this[id]; GL.BindVertexArray(Handle); vboBase.Bind(); GL.EnableVertexAttribArray(attribArrayIdx); GL.VertexAttribPointer(attribArrayIdx, vboBase.ElementSize, type, normalized, stride, offset); //GL.BindVertexArray(0); //VboBase.Unbind(); }
public void EnableAttribI( VboPosition id, int attribArrayIdx = -1, VertexAttribIntegerType type = VertexAttribIntegerType.Int, int stride = 0, int offset = 0) { if (attribArrayIdx < 0) attribArrayIdx = (int)id; VboBase vboBase = this[id]; GL.BindVertexArray(Handle); vboBase.Bind(); GL.EnableVertexAttribArray(attribArrayIdx); GL.VertexAttribIPointer(attribArrayIdx, vboBase.ElementSize, type, stride, new IntPtr(offset)); //GL.BindVertexArray(0); //VboBase.Unbind(); }
protected VboBase this[VboPosition id] { get { return m_vbos[(int)id]; } set { m_vbos[(int)id] = value; } }
protected void Update <T>(VboPosition id, T[] data, int count = -1, int offset = 0) where T : struct { // No cast checking, should be covered by tests and usage ((Vbo <T>) base[id]).Update(data, count, offset); }
protected VboBase this[VboPosition id] { get { return(m_vbos[(int)id]); } set { m_vbos[(int)id] = value; } }