/// <summary>
        /// Gets shader's source code for color coded picking.
        /// </summary>
        /// <param name="shaderType"></param>
        /// <returns></returns>
        public static string GetShaderSource(ShaderTypes shaderType)
        {
            string result = string.Empty;

            switch (shaderType)
            {
            case ShaderTypes.VertexShader:
                if (vertexShader == null)
                {
                    vertexShader = ManifestResourceLoader.LoadTextFile(@"ColorCodedPicking\PickingShader.vert");
                }
                result = vertexShader;
                break;

            case ShaderTypes.FragmentShader:
                if (fragmentShader == null)
                {
                    fragmentShader = ManifestResourceLoader.LoadTextFile(@"ColorCodedPicking\PickingShader.frag");
                }
                result = fragmentShader;
                break;

            default:
                throw new NotImplementedException();
            }

            return(result);
        }
        /// <summary>
        /// Initialises the scene.
        /// </summary>
        /// <param name="gl">The OpenGL instance.</param>
        /// <param name="width">The width of the screen.</param>
        /// <param name="height">The height of the screen.</param>
        public void Initialise(OpenGL gl)
        {
            //  Set a blue clear colour.
            gl.ClearColor(0.4f, 0.6f, 0.9f, 0.5f);

            {
                //  Create the shader program.
                var vertexShaderSource   = ManifestResourceLoader.LoadTextFile(@"Model\Shader.vert");
                var fragmentShaderSource = ManifestResourceLoader.LoadTextFile(@"Model\Shader.frag");
                var shaderProgram        = new ShaderProgram();
                shaderProgram.Create(gl, vertexShaderSource, fragmentShaderSource, null);
                shaderProgram.BindAttributeLocation(gl, attributeIndexPosition, "in_Position");
                shaderProgram.BindAttributeLocation(gl, attributeIndexColour, "in_Color");
                shaderProgram.AssertValid(gl);
                this.shaderProgram = shaderProgram;
            }
            {
                //  Create the picking shader program.
                var vertexShaderSource   = ColorCodedPickingShaderHelper.GetShaderSource(ColorCodedPickingShaderHelper.ShaderTypes.VertexShader);
                var fragmentShaderSource = ColorCodedPickingShaderHelper.GetShaderSource(ColorCodedPickingShaderHelper.ShaderTypes.FragmentShader);
                var shaderProgram        = new ShaderProgram();
                shaderProgram.Create(gl, vertexShaderSource, fragmentShaderSource, null);
                shaderProgram.BindAttributeLocation(gl, attributeIndexPosition, "in_Position");
                shaderProgram.BindAttributeLocation(gl, attributeIndexColour, "in_Color");
                shaderProgram.AssertValid(gl);
                this.pickingShaderProgram = shaderProgram;
            }

            unsafe
            {
                //  Create the vertex array object.
                vertexBufferArray = new VertexBufferArray();
                vertexBufferArray.Create(gl);
                vertexBufferArray.Bind(gl);

                //  Create a vertex buffer for the vertex data.
                var vertexDataBuffer = new VertexBuffer();
                vertexDataBuffer.Create(gl);
                vertexDataBuffer.Bind(gl);
                //vertexDataBuffer.SetData(gl, 0,
                //this.Model.VertexCount * sizeof(Vertex), (IntPtr)this.Model.Positions, false, 3, OpenGL.GL_FLOAT);
                vertexDataBuffer.SetData(gl, 0, this.Model.Positions, false, 3);

                //  Now do the same for the colour data.
                var colourDataBuffer = new VertexBuffer();
                colourDataBuffer.Create(gl);
                colourDataBuffer.Bind(gl);
                //colourDataBuffer.SetData(gl, 1,
                //this.Model.VertexCount * sizeof(ByteColor), (IntPtr)this.Model.Colors, false, 3, OpenGL.GL_BYTE);
                colourDataBuffer.SetData(gl, 1, this.Model.Colors, false, 3);

                //  Unbind the vertex array, we've finished specifying data for it.
                vertexBufferArray.Unbind(gl);
            }
            ////  Create a perspective projection matrix.
            //const float rads = (60.0f / 360.0f) * (float)Math.PI * 2.0f;
            //projectionMatrix = glm.perspective(rads, width / height, 0.1f, 100.0f);

            ////  Create a view matrix to move us back a bit.
            //viewMatrix = glm.translate(new mat4(1.0f), new vec3(0.0f, 0.0f, -5.0f));

            ////  Create a model matrix to make the model a little bigger.
            //modelMatrix = glm.scale(new mat4(1.0f), new vec3(2.5f));
            ////IPerspectiveCamera camera = this.cameraRotation.Camera;
            ////projectionMatrix = camera.GetProjectionMat4();
            ////viewMatrix = this.cameraRotation.Camera.GetViewMat4();
            ////modelMatrix = mat4.identity();

            ////  Now create the geometry for the square.
            //CreateVertices(gl);

            this.initialised = true;
        }