//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * 頂点プロセスタイプヘッダ
 * @author Junpee
 */

#ifndef VERTEX_PROCESSING_TYPE_H_
#define VERTEX_PROCESSING_TYPE_H_

namespace Lamp{

//------------------------------------------------------------------------------
/**
 * 頂点プロセスタイプ
 */
class VertexProcessingType{
public:
	/// 頂点プロセスタイプ
	enum Type{
		/// ソフトウェア頂点プロセス
		software,
		/// 混合頂点プロセス
		mixed,
		/// ハードウェア頂点プロセス
		hardware,
		/// ピュアハードウェア頂点プロセス
		pureHardware
	};

	/**
	 * コンストラクタ
	 */
	VertexProcessingType(){ type_ = software; }

	/**
	 * コピーコンストラクタ
	 * @param copy コピー元
	 */
	VertexProcessingType(const VertexProcessingType& copy){
		type_ = copy.type_;
	}

	/**
	 * コピーコンストラクタ
	 * @param copy コピー元
	 */
	VertexProcessingType(const Type& copy){ type_ = copy; }

	/**
	 * 代入コピーの隠蔽
	 * @param copy コピー元
	 */
	void operator =(const VertexProcessingType& copy){ type_ = copy.type_; }

	/**
	 * 代入コピーの隠蔽
	 * @param copy コピー元
	 */
	void operator =(const Type& copy){ type_ = copy; }

	/**
	 * 作成フラグの取得
	 * @return 作成フラグ
	 */
	u_int getCreateFlag(){
		u_int result;
		if(type_ == software){
			result = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
		}else if(type_ == mixed){
			result = D3DCREATE_MIXED_VERTEXPROCESSING;
		}else if(type_ == hardware){
			result = D3DCREATE_HARDWARE_VERTEXPROCESSING;
		}else if(type_ == pureHardware){
			result = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE;
		}
		return result;
	}

	/**
	 * 文字列への変換
	 * @return 頂点プロセスタイプの文字列表記
	 */
	String toString(){
		if(type_ == software){ return "ソフトウェア"; }
		else if(type_ == mixed){ return "混合"; 	}
		else if(type_ == hardware){ return "ハードウェア"; }
		else if(type_ == pureHardware){ return "ピュアハードウェア"; }
		return "";
	}

	/// 頂点プロセスタイプ
	Type type_;

};

//------------------------------------------------------------------------------
} // End of namespace Lamp
#endif // End of VERTEX_PROCESSING_TYPE_H_
//------------------------------------------------------------------------------
