private void setupVertexArray(Shader shader)
        {
            bool initial = currentShader == null;

            if (initial)
            {
                vertexArrayId = GL.GenVertexArray();
            }

            GL.BindVertexArray(vertexArrayId);

            // Vertex

            GL.BindBuffer(BufferTarget.ArrayBuffer, vertexBufferId);

            if (!initial)
            {
                vertexDeclaration.DeactivateAttributes(currentShader);
            }
            vertexDeclaration.ActivateAttributes(shader);

            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);

            // Index

            if (initial && indexBufferId != -1)
            {
                GL.BindBuffer(BufferTarget.ElementArrayBuffer, indexBufferId);
            }

            GL.BindVertexArray(0);

            currentShader = shader;
        }
        protected virtual void internalBind(Shader shader)
        {
            GL.BindBuffer(BufferTarget.ArrayBuffer, vertexBufferId);
            GL.BindBuffer(BufferTarget.ElementArrayBuffer, indexBufferId);

            vertexDeclaration.ActivateAttributes(shader);
            currentShader = shader;
        }