fnOGLArgumentProcessor()
{
#$1 is sample to be run
#$2 is X res
#$3 is Y res
#$4 is Refresh rate
#$5 is display head
#$6 is either of "nooptions" "vcaa" "fsaa" "vcfsaa"
#$7 is "limitedresolutions" or "allresolutions"
#$8 is time duration of run

cd /root/$TARGET_PATH/samples/opengles2/$1

echo
echo "************************************************************************"
echo "************************************************************************" >>~/OGL.log
echo "Running $1 in $2 x $3 @ $4 Hz on $5 head with $6 enabled...."
echo "Running $1 in $2 x $3 @ $4 Hz on $5 head with $6 enabled...." >>~/OGL.log


if [ "$7" = "limitedresolutions" ]; then
#limited resolutions don't need the refresh rate parameter to be passed
	case $1 in
	'gears')
	#gears doesn't require time parameter to be passed to obtain score
		if [ "$6" = "nooptions" ]; then
			./$1 -res $2 $3 -disp $5 &>> ~/fps.log
		elif [ "$6" = "vcaa" ]; then
			./$1 -res $2 $3 -disp $5 -vcaa 5 &>> ~/fps.log
		elif [ "$6" = "fsaa" ]; then
			./$1 -res $2 $3 -disp $5 -fsaa 4 &>> ~/fps.log
		elif [ "$6" = "vcfsaa" ]; then
			./$1 -res $2 $3 -disp $5 -vcaa 5 -fsaa 4  &>> ~/fps.log
		fi
	;;
	*)
	#ctree has time-to-run passed as parameter to account for suitable time for logging fps score. If bubble fps capture strategy is different from ctree, then this case statement has to be modified accordingly
		if [ "$6" = "nooptions" ]; then
			./$1 -res $2 $3 -disp $5 -sec $8 &>> ~/fps.log
		elif [ "$6" = "vcaa" ]; then
			./$1 -res $2 $3 -disp $5 -vcaa 5 -sec $8 &>> ~/fps.log
		elif [ "$6" = "fsaa" ]; then
			./$1 -res $2 $3 -disp $5 -fsaa 4 -sec $8 &>> ~/fps.log
		elif [ "$6" = "vcfsaa" ]; then
			./$1 -res $2 $3 -disp $5 -vcaa 5 -fsaa 4 -sec $8 &>> ~/fps.log
		fi
	;;
	esac
elif  [ "$7" = "allresolutions" ]; then
#allresolutions include the refresh rate parameter to be passed
	case $1 in
	'gears')
	#gears doesn't require time parameter to be passed to obtain score
		if [ "$6" = "nooptions" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 &>> ~/fps.log
		elif [ "$6" = "vcaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -vcaa 5 &>> ~/fps.log
		elif [ "$6" = "fsaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -fsaa 4 &>> ~/fps.log
		elif [ "$6" = "vcfsaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -vcaa 5 -fsaa 4  &>> ~/fps.log
		fi
	;;
	*)
	#ctree has time-to-run passed as parameter to account for suitable time for logging fps score. If bubble fps capture strategy is different from ctree, then this case statement has to be modified accordingly
		if [ "$6" = "nooptions" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -sec $8 &>> ~/fps.log
		elif [ "$6" = "vcaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -vcaa 5 -sec $8 &>> ~/fps.log
		elif [ "$6" = "fsaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -fsaa 4 -sec $8 &>> ~/fps.log
		elif [ "$6" = "vcfsaa" ]; then
			./$1 -res $2 $3 -refresh $4 -disp $5 -vcaa 5 -fsaa 4 -sec $8 &>> ~/fps.log
		fi
	;;
	esac
fi

}