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 FIXED_SHADER_H_ 00026 #define FIXED_SHADER_H_ 00027 00028 #include <Graphics/Shader/Shader.h> 00029 00030 namespace Lamp{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * 固定パイプラインシェーダ 00035 */ 00036 class FixedShader : public Shader{ 00037 friend class ShaderManager; 00038 public: 00039 00040 protected: 00041 /** 00042 * コンストラクタ 00043 */ 00044 FixedShader(); 00045 00046 /** 00047 * デストラクタ 00048 */ 00049 virtual ~FixedShader(); 00050 00051 //-------------------------------------------------------------------------- 00052 // ステートブロック 00053 //-------------------------------------------------------------------------- 00054 /** 00055 * マテリアル開始の構築 00056 * @param material マテリアル 00057 */ 00058 virtual void buildMaterialStart(Material* material); 00059 00060 /** 00061 * マテリアル終了の構築 00062 * @param material マテリアル 00063 */ 00064 //virtual void buildMaterialEnd(Material* material); 00065 00066 //-------------------------------------------------------------------------- 00067 // テクスチャ 00068 //-------------------------------------------------------------------------- 00069 /** 00070 * 固定機能テクスチャ設定 00071 * @param textureStage テクスチャステージ 00072 * @param texture テクスチャ 00073 */ 00074 virtual void setFixedTexture(int textureStage, Texture* texture); 00075 00076 00077 /** 00078 * 固定機能ベーステクスチャの設定 00079 * @param colorStage カラーステージ 00080 * @param baseTexture ベーステクスチャ 00081 * @param baseUVIndex ベースUVインデックス 00082 * @return カラーステージ 00083 */ 00084 virtual int setFixedBaseTexture( 00085 int colorStage, Texture* baseTexture, int baseUVIndex); 00086 00087 //-------------------------------------------------------------------------- 00088 /** 00089 * 固定機能ライトテクスチャの設定 00090 * @param colorStage カラーステージ 00091 * @param lightTexture ライトテクスチャ 00092 * @param lightUVIndex ライトUVインデックス 00093 * @return カラーステージ 00094 */ 00095 virtual int setFixedLightTexture( 00096 int colorStage, Texture* lightTexture, int lightUVIndex); 00097 00098 //-------------------------------------------------------------------------- 00099 /** 00100 * 固定機能汚れテクスチャの設定 00101 * @param colorStage カラーステージ 00102 * @param stainTexture 汚れテクスチャ 00103 * @param stainUVIndex 汚れUVインデックス 00104 * @return カラーステージ 00105 */ 00106 virtual int setFixedStainTexture( 00107 int colorStage, Texture* stainTexture, int stainUVIndex); 00108 00109 //-------------------------------------------------------------------------- 00110 // 描画の初期化 00111 //-------------------------------------------------------------------------- 00112 /** 00113 * 固定機能描画のセットアップ 00114 * @param request 描画リクエスト 00115 */ 00116 virtual void setupFixedDraw(DrawRequest* request); 00117 00118 //-------------------------------------------------------------------------- 00119 /** 00120 * 固定機能行列の設定 00121 * @param request 描画リクエスト 00122 */ 00123 virtual void setMatrixFixed(DrawRequest* request); 00124 00125 /** 00126 * 固定機能フォグオプションの設定 00127 * @param request 描画リクエスト 00128 */ 00129 virtual void setFogOptionFixed(DrawRequest* request); 00130 00131 /** 00132 * 固定機能ライトのセットアップ 00133 * @param request 描画リクエスト 00134 */ 00135 virtual void setupFixedLight(DrawRequest* request); 00136 00137 //-------------------------------------------------------------------------- 00138 // 描画 00139 //-------------------------------------------------------------------------- 00140 /** 00141 * 固定機能描画 00142 * @param request 描画リクエスト 00143 */ 00144 virtual void drawFixed(DrawRequest* request); 00145 00146 //-------------------------------------------------------------------------- 00147 // 描画の後始末 00148 //-------------------------------------------------------------------------- 00149 /** 00150 * 固定機能描画のリセット 00151 * @param request 描画リクエスト 00152 */ 00153 virtual void resetFixedDraw(DrawRequest* request); 00154 00155 /** 00156 * 固定機能フォグオプションのリセット 00157 * @param request 描画リクエスト 00158 */ 00159 virtual void resetFogOptionFixed(DrawRequest* request); 00160 00161 //-------------------------------------------------------------------------- 00162 private: 00163 00164 }; 00165 00166 //------------------------------------------------------------------------------ 00167 } // End of namespace Lamp 00168 #endif // End of FIXED_SHADER_H_ 00169 //------------------------------------------------------------------------------