FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
ShaderParameter.h
[詳解]
1#if !defined(__FK_SHADER_PARAMETER_HEADER__)
2#define __FK_SHADER_PARAMETER_HEADER__
3
4#include <FK/Texture.h>
5#include <string>
6#include <map>
7
8namespace FK {
9 class fk_ShaderProgram;
10
12
20
21#if !defined(FK_DOXYGEN_USER_PROCESS)
22 class Member {
23 public:
24 std::map<std::string, float> floatTable;
25 std::map<std::string, std::vector<float>> floatArrayTable;
26 std::map<std::string, int> intTable;
27 std::map<std::string, std::vector<int>> intArrayTable;
28 std::map<std::string, fk_Matrix> matrixTable;
29 std::map<std::string, int> locationTable;
30 std::map<std::string, int> attrTable;
31 std::map<int, fk_Texture *> textureTable;
32 std::string lastError;
33 unsigned int lastAppliedId;
34 fk_ShaderProgram *prog;
35
36 Member(void);
37 };
38#endif
39 public:
42
45
47
51 std::string getLastError(void);
52
54
63 void setRegister(std::string name, float value, std::string = "");
64
66
77 void setRegister(std::string name, std::vector<float> *value, std::string = "");
78
80
89 void setRegister(std::string name, int value, std::string = "");
90
92
103 void setRegister(std::string name, std::vector<int> *value, std::string = "");
104
106
116 void setRegister(std::string name, fk_Vector *value, std::string = "");
117
119
129 void setRegister(std::string name, fk_HVector *value, std::string = "");
130
132
142 void setRegister(std::string name, fk_Matrix *value, std::string = "");
143
145
155 bool removeRegister(std::string name);
156
158
165 void reserveAttribute(std::string name);
166
168
187 bool attachTexture(int unit, fk_Texture *texture);
188
190
199 bool detachTexture(int unit);
200
202
205 void clearTexture(void);
206
207#if !defined(FK_DOXYGEN_USER_PROCESS)
208 bool Apply(GLuint);
209 void BindAttr(GLuint);
210 std::map<std::string, int> * getAttrTable(void);
211 void SetProgram(fk_ShaderProgram *);
212 fk_ShaderProgram * GetProgram(void);
213#endif
214
215 private:
216 std::unique_ptr<Member> _m;
217 GLint GetLocation(GLuint, std::string);
218 };
219}
220
221#endif
222
223/****************************************************************************
224 *
225 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
226 *
227 * Redistribution and use in source and binary forms,
228 * with or without modification, are permitted provided that the
229 * following conditions are met:
230 *
231 * - Redistributions of source code must retain the above
232 * copyright notice, this list of conditions and the
233 * following disclaimer.
234 *
235 * - Redistributions in binary form must reproduce the above
236 * copyright notice, this list of conditions and the
237 * following disclaimer in the documentation and/or
238 * other materials provided with the distribution.
239 *
240 * - Neither the name of the copyright holders nor the names
241 * of its contributors may be used to endorse or promote
242 * products derived from this software without specific
243 * prior written permission.
244 *
245 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
246 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
247 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
248 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
249 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
250 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
251 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
252 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
253 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
254 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
255 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
256 * POSSIBILITY OF SUCH DAMAGE.
257 *
258 ****************************************************************************/
259/****************************************************************************
260 *
261 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
262 *
263 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
264 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
265 *
266 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
267 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
268 *
269 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
270 * および下記免責条項を含めること。
271 *
272 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
273 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
274 * 含めること。
275 *
276 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
277 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
278 * コントリビューターの名前を使用してはならない。
279 *
280 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
281 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
282 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
283 * に限定されない、いかなる保証もないものとします。著作権者もコン
284 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
285 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
286 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
287 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
288 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
289 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
290 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
291 * ついて、一切責任を負わないものとします。
292 *
293 ****************************************************************************/
4次元ベクトルを管理するクラス
Definition Vector.h:497
一般4元正方行列を管理するクラス
Definition Matrix.h:549
シェーダーパラメーター管理クラス
Definition ShaderParameter.h:19
void setRegister(std::string name, fk_Matrix *value, std::string="")
fk_Matrix 型 uniform 変数設定関数
void setRegister(std::string name, int value, std::string="")
int 型 uniform 変数設定関数
void setRegister(std::string name, float value, std::string="")
float 型 uniform 変数設定関数
void setRegister(std::string name, fk_Vector *value, std::string="")
fk_Vector 型 uniform 変数設定関数
bool detachTexture(int unit)
参照テクスチャ解除関数
std::string getLastError(void)
エラーメッセージプロパティ
void setRegister(std::string name, std::vector< int > *value, std::string="")
int 配列型 uniform 変数設定関数
bool attachTexture(int unit, fk_Texture *texture)
参照テクスチャ設定関数
fk_ShaderParameter()
コンストラクタ
void setRegister(std::string name, std::vector< float > *value, std::string="")
float 配列型 uniform 変数設定関数
void reserveAttribute(std::string name)
attribute 変数予約関数
void setRegister(std::string name, fk_HVector *value, std::string="")
fk_HVector 型 uniform 変数設定関数
virtual ~fk_ShaderParameter()
デストラクタ
void clearTexture(void)
参照テクスチャ全解除関数
bool removeRegister(std::string name)
uniform 変数解除関数
シェーダープログラム格納クラス
Definition ShaderProgram.h:23
テクスチャ用基底クラス
Definition Texture.h:45
3次元ベクトルを管理するクラス
Definition Vector.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6