private void InitVertexes(OpenGL gl, UnmanagedArray <Vertex> vertexes, UnmanagedArray <ColorF> colorArray, UnmanagedArray <float> visibles) { uint[] vao = new uint[1]; gl.GenVertexArrays(vao.Length, vao); gl.BindVertexArray(vao[0]); this.vertexArrayObject = vao[0]; uint[] vboVertex = new uint[1]; gl.GenBuffers(vboVertex.Length, vboVertex); gl.BindBuffer(OpenGL.GL_ARRAY_BUFFER, vboVertex[0]); gl.BufferData(OpenGL.GL_ARRAY_BUFFER, vertexes.ByteLength, vertexes.Header, OpenGL.GL_STATIC_DRAW); gl.VertexAttribPointer(ATTRIB_INDEX_POSITION, 3, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero); gl.EnableVertexAttribArray(ATTRIB_INDEX_POSITION); this.vertexsBufferObject = vboVertex[0]; uint[] vboColor = new uint[1]; gl.GenBuffers(vboColor.Length, vboColor); gl.BindBuffer(OpenGL.GL_ARRAY_BUFFER, vboColor[0]); gl.BufferData(OpenGL.GL_ARRAY_BUFFER, colorArray.ByteLength, colorArray.Header, OpenGL.GL_DYNAMIC_DRAW); gl.VertexAttribPointer(ATTRIB_INDEX_COLOUR, 4, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero); gl.EnableVertexAttribArray(ATTRIB_INDEX_COLOUR); this.colorsBufferObject = vboColor[0]; uint[] vboVisual = new uint[1]; gl.GenBuffers(vboVisual.Length, vboVisual); gl.BindBuffer(OpenGL.GL_ARRAY_BUFFER, vboVisual[0]); gl.BufferData(OpenGL.GL_ARRAY_BUFFER, visibles.ByteLength, visibles.Header, OpenGL.GL_DYNAMIC_READ); gl.VertexAttribPointer(ATTRIB_INDEX_VISIBLE, 1, OpenGL.GL_FLOAT, false, 0, IntPtr.Zero); gl.EnableVertexAttribArray(ATTRIB_INDEX_VISIBLE); this.visiblesBufferObject = vboVisual[0]; gl.BindVertexArray(0); }