00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * 頂点プロセスタイプヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef VERTEX_PROCESSING_TYPE_H_ 00026 #define VERTEX_PROCESSING_TYPE_H_ 00027 00028 namespace Lamp{ 00029 00030 //------------------------------------------------------------------------------ 00031 /** 00032 * 頂点プロセスタイプ 00033 */ 00034 class VertexProcessingType{ 00035 public: 00036 /// 頂点プロセスタイプ 00037 enum Type{ 00038 /// ソフトウェア頂点プロセス 00039 software, 00040 /// 混合頂点プロセス 00041 mixed, 00042 /// ハードウェア頂点プロセス 00043 hardware, 00044 /// ピュアハードウェア頂点プロセス 00045 pureHardware 00046 }; 00047 00048 /** 00049 * コンストラクタ 00050 */ 00051 VertexProcessingType(){ type_ = software; } 00052 00053 /** 00054 * コピーコンストラクタ 00055 * @param copy コピー元 00056 */ 00057 VertexProcessingType(const VertexProcessingType& copy){ 00058 type_ = copy.type_; 00059 } 00060 00061 /** 00062 * コピーコンストラクタ 00063 * @param copy コピー元 00064 */ 00065 VertexProcessingType(const Type& copy){ type_ = copy; } 00066 00067 /** 00068 * 代入コピーの隠蔽 00069 * @param copy コピー元 00070 */ 00071 void operator =(const VertexProcessingType& copy){ type_ = copy.type_; } 00072 00073 /** 00074 * 代入コピーの隠蔽 00075 * @param copy コピー元 00076 */ 00077 void operator =(const Type& copy){ type_ = copy; } 00078 00079 /** 00080 * 作成フラグの取得 00081 * @return 作成フラグ 00082 */ 00083 u_int getCreateFlag(){ 00084 u_int result; 00085 if(type_ == software){ 00086 result = D3DCREATE_SOFTWARE_VERTEXPROCESSING; 00087 }else if(type_ == mixed){ 00088 result = D3DCREATE_MIXED_VERTEXPROCESSING; 00089 }else if(type_ == hardware){ 00090 result = D3DCREATE_HARDWARE_VERTEXPROCESSING; 00091 }else if(type_ == pureHardware){ 00092 result = D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE; 00093 } 00094 return result; 00095 } 00096 00097 /** 00098 * 文字列への変換 00099 * @return 頂点プロセスタイプの文字列表記 00100 */ 00101 String toString(){ 00102 if(type_ == software){ return "ソフトウェア"; } 00103 else if(type_ == mixed){ return "混合"; } 00104 else if(type_ == hardware){ return "ハードウェア"; } 00105 else if(type_ == pureHardware){ return "ピュアハードウェア"; } 00106 return ""; 00107 } 00108 00109 /// 頂点プロセスタイプ 00110 Type type_; 00111 00112 }; 00113 00114 //------------------------------------------------------------------------------ 00115 } // End of namespace Lamp 00116 #endif // End of VERTEX_PROCESSING_TYPE_H_ 00117 //------------------------------------------------------------------------------