FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
ShaderProgram.h
[詳解]
1#if !defined(__FK_SHADER_PROGRAM_HEADER__)
2#define __FK_SHADER_PROGRAM_HEADER__
3
4#include <FK/Engine.hh>
6
7namespace FK {
8
9#if !defined(FK_DOXYGEN_USER_PROCESS)
10 using fk_BuildInKey = std::pair<std::string, std::string>;
11#endif
12
14
24
25#if !defined(FK_DOXYGEN_USER_PROCESS)
26 class Member {
27 public:
28 GLuint idProgram;
29 GLuint idVertex;
30 GLuint idFragment;
31 GLuint idGeometry;
32 GLuint idTessCtrl;
33 GLuint idTessEval;
34
35 std::string lastError;
36 fk_ShaderParameter *parameter;
37 bool fboMode;
38
39 std::map<std::string, bool> uniformStatus;
40 std::map<std::string, bool> attributeStatus;
41
42 Member(void);
43 };
44#endif
45
46 public:
48
54 std::string vertexShaderSource;
55
57
64
66
73
75
83
85
92
95
98
100
109 GLuint getProgramID(void);
110
112
118 std::string getLastError(void);
119
121
135 bool loadVertexShader(std::string fileName);
136
138
152 bool loadFragmentShader(std::string fileName);
153
155
169 bool loadGeometryShader(std::string fileName);
170
171
173
187 bool loadTessCtrlShader(std::string fileName);
188
190
204 bool loadTessEvalShader(std::string fileName);
205
207
217 bool validate(void);
218
220
228 bool link(void);
229
230#if !defined(FK_DOXYGEN_USER_PROCESS)
231 void SetParameter(fk_ShaderParameter *);
232 void SetFBOMode(bool);
233
234 bool GetUniformStatus(std::string);
235 bool GetAttributeStatus(std::string);
236
237#endif
238
239 private:
240
241 static inline std::string vertexBuildIn;
242 static inline std::string fragmentBuildIn;
243 static inline std::string geometryBuildIn;
244 static inline std::string tessCtrlBuildIn;
245 static inline std::string tessEvalBuildIn;
246 static inline std::string fboBuildIn;
247 static inline std::vector<fk_BuildInKey> uniformStack;
248 static inline std::vector<fk_BuildInKey> attributeStack;
249
250 std::unique_ptr<Member> _m;
251
252 GLuint Compile(std::string *, GLuint);
253 bool UpdateLastError(GLuint, std::string);
254 void ReplaceBuildIn(std::string *, GLuint);
255 void DeleteShader(GLuint);
256 void DeleteProgram(GLuint);
257
258 void MakeBuildInStack(std::string *, std::vector<fk_BuildInKey> *);
259 };
260}
261#endif
262
263/****************************************************************************
264 *
265 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
266 *
267 * Redistribution and use in source and binary forms,
268 * with or without modification, are permitted provided that the
269 * following conditions are met:
270 *
271 * - Redistributions of source code must retain the above
272 * copyright notice, this list of conditions and the
273 * following disclaimer.
274 *
275 * - Redistributions in binary form must reproduce the above
276 * copyright notice, this list of conditions and the
277 * following disclaimer in the documentation and/or
278 * other materials provided with the distribution.
279 *
280 * - Neither the name of the copyright holders nor the names
281 * of its contributors may be used to endorse or promote
282 * products derived from this software without specific
283 * prior written permission.
284 *
285 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
286 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
287 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
288 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
289 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
290 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
291 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
292 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
293 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
294 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
295 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
296 * POSSIBILITY OF SUCH DAMAGE.
297 *
298 ****************************************************************************/
299/****************************************************************************
300 *
301 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
302 *
303 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
304 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
305 *
306 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
307 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
308 *
309 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
310 * および下記免責条項を含めること。
311 *
312 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
313 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
314 * 含めること。
315 *
316 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
317 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
318 * コントリビューターの名前を使用してはならない。
319 *
320 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
321 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
322 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
323 * に限定されない、いかなる保証もないものとします。著作権者もコン
324 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
325 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
326 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
327 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
328 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
329 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
330 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
331 * ついて、一切責任を負わないものとします。
332 *
333 ****************************************************************************/
シェーダーパラメーター管理クラス
Definition ShaderParameter.h:19
シェーダープログラム格納クラス
Definition ShaderProgram.h:23
bool loadGeometryShader(std::string fileName)
ジオメトリシェーダーコード入力関数
std::string getLastError(void)
エラーメッセージ取得関数
std::string tessEvalShaderSource
テッセレーション評価シェーダーコードメンバー
Definition ShaderProgram.h:91
std::string vertexShaderSource
バーテックスシェーダーコードメンバー
Definition ShaderProgram.h:54
std::string tessCtrlShaderSource
テッセレーション制御コードメンバー
Definition ShaderProgram.h:82
bool validate(void)
シェーダープログラムコンパイルメソッド
bool loadFragmentShader(std::string fileName)
フラグメントシェーダーコード入力関数
bool loadVertexShader(std::string fileName)
バーテックスシェーダーコード入力関数
bool loadTessCtrlShader(std::string fileName)
テッセレーション制御シェーダーコード入力関数
bool loadTessEvalShader(std::string fileName)
テッセレーション評価シェーダーコード入力関数
bool link(void)
シェーダープログラムリンクメソッド
fk_ShaderProgram(void)
コンストラクタ
GLuint getProgramID(void)
ID取得関数
std::string geometryShaderSource
ジオメトリシェーダーコードメンバー
Definition ShaderProgram.h:72
std::string fragmentShaderSource
フラグメントシェーダーコードメンバー
Definition ShaderProgram.h:63
~fk_ShaderProgram()
デストラクタ
Fine Kernel Toolkit 名前空間
Definition Angle.h:6