public void SetMatrix(string name, int count, bool transpose, XNA.Matrix values, eMatrixType matrixType)
        {
            switch (matrixType)
            {
            case eMatrixType.Matrix2:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M21, values.M22 }, matrixType);
                break;

            case eMatrixType.Matrix2x3:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M21, values.M22, values.M31, values.M32 }, matrixType);
                break;

            case eMatrixType.Matrix2x4:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M21, values.M22, values.M31, values.M32, values.M41, values.M42 }, matrixType);
                break;

            case eMatrixType.Matrix3:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M21, values.M22, values.M23, values.M31, values.M32, values.M33, values.M41, values.M42, values.M43 }, matrixType);
                break;

            case eMatrixType.Matrix3x2:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M21, values.M22, values.M23, values.M31, values.M32, values.M33 }, matrixType);
                break;

            case eMatrixType.Matrix3x4:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M21, values.M22, values.M23, values.M31, values.M32, values.M33, values.M41, values.M42, values.M43 }, matrixType);
                break;

            case eMatrixType.Matrix4:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M14, values.M21, values.M22, values.M23, values.M24, values.M31, values.M32, values.M33, values.M34, values.M41, values.M42, values.M43, values.M44 }, matrixType);
                break;

            case eMatrixType.Matrix4x2:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M14, values.M21, values.M22, values.M23, values.M24 }, matrixType);
                break;

            case eMatrixType.Matrix4x3:
                SetMatrix(name, count, transpose, new float[] { values.M11, values.M12, values.M13, values.M14, values.M21, values.M22, values.M23, values.M24, values.M31, values.M32, values.M33, values.M34 }, matrixType);
                break;

            default:
                break;
            }
        }
        public void SetMatrix(string name, int count, bool transpose, float[] values, eMatrixType matrixType)
        {
            switch (matrixType)
            {
            case eMatrixType.Matrix2:
                Gl.UniformMatrix2(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix2x3:
                Gl.UniformMatrix2x3(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix2x4:
                Gl.UniformMatrix2x4(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix3:
                Gl.UniformMatrix3(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix3x2:
                Gl.UniformMatrix3x2(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix3x4:
                Gl.UniformMatrix3x4(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix4:
                Gl.UniformMatrix4(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix4x2:
                Gl.UniformMatrix4x2(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            case eMatrixType.Matrix4x3:
                Gl.UniformMatrix4x3(Gl.GetUniformLocation(ProgramID, name), count, transpose, values);
                break;

            default:
                break;
            }
        }