FineKernelToolKit 4.2.13
読み取り中…
検索中…
一致する文字列を見つけられません
ShaderBinder.h
[詳解]
1#if !defined(__FK_SHADER_BINDER_HEADER__)
2#define __FK_SHADER_BINDER_HEADER__
3
4#include <FK/AppWindow.h>
5#include <FK/ShaderProgram.h>
6#include <FK/FrameBuffer.h>
7
8namespace FK {
10
35
36#if !defined(FK_DOXYGEN_USER_PROCESS)
37 class Member {
38 public:
39 fk_ShaderProgram innerProgram;
40 fk_ShaderParameter innerParameter;
41 fk_ShaderProgram *program;
42 fk_ShaderParameter *parameter;
43 bool usingProgram;
44 bool setupFlg;
45 GLint bufW, bufH;
46 std::vector<float> fboSize;
47
48 Member(void);
49 };
50#endif
51 public:
53
58
61
63
73
75
85
87
99 void bindModel(fk_Model *model);
100
102
109 void unbindModel(fk_Model *model);
110
112
129 void initializeFrameBufferObject(int width, int height);
130
132
144
146
158 void bindWindow(fk_Window *window);
159
161
174
176
185 void unbindWindow(fk_Window *window);
186
188
198
199#if !defined(FK_DOXYGEN_USER_PROCESS)
200 void ProcPreShader(void);
201 void ProcPostShader(void);
202 void SetupDone(bool = true);
203 bool IsSetup(void);
204 static bool Initialize(void);
205 static bool IsInitialized(void);
206
207 void LoadFBOShader(void);
208
209 static inline const std::string colorBufName = "fk_ColorBuf";
210 static inline const std::string depthBufName = "fk_DepthBuf";
211 static inline const std::string shadowBufName = "fk_ShadowBuf";
212 static inline const std::string fboTexCoordName = "fk_FBOTexCoord";
213 static inline const std::string fboSizeName = "fk_FBOSize";
214
215#endif
216
217 private:
218 std::unique_ptr<Member> _m;
219
220 static inline bool isExtensionInitialized;
221 static inline std::string fboVertexCode;
222 static inline std::string fboGeometryCode;
223 };
224}
225
226#endif
227
228/****************************************************************************
229 *
230 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
231 *
232 * Redistribution and use in source and binary forms,
233 * with or without modification, are permitted provided that the
234 * following conditions are met:
235 *
236 * - Redistributions of source code must retain the above
237 * copyright notice, this list of conditions and the
238 * following disclaimer.
239 *
240 * - Redistributions in binary form must reproduce the above
241 * copyright notice, this list of conditions and the
242 * following disclaimer in the documentation and/or
243 * other materials provided with the distribution.
244 *
245 * - Neither the name of the copyright holders nor the names
246 * of its contributors may be used to endorse or promote
247 * products derived from this software without specific
248 * prior written permission.
249 *
250 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
251 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
252 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
253 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
254 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
255 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
256 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
257 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
258 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
259 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
260 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261 * POSSIBILITY OF SUCH DAMAGE.
262 *
263 ****************************************************************************/
264/****************************************************************************
265 *
266 * Copyright (c) 1999-2024, Fine Kernel Project, All rights reserved.
267 *
268 * 本ソフトウェアおよびソースコードのライセンスは、基本的に
269 * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
270 *
271 * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
272 * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
273 *
274 * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
275 * および下記免責条項を含めること。
276 *
277 * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
278 * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
279 * 含めること。
280 *
281 * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
282 * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
283 * コントリビューターの名前を使用してはならない。
284 *
285 * 本ソフトウェアは、著作権者およびコントリビューターによって「現
286 * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
287 * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
288 * に限定されない、いかなる保証もないものとします。著作権者もコン
289 * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
290 * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
291 * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
292 * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
293 * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
294 * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
295 * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
296 * ついて、一切責任を負わないものとします。
297 *
298 ****************************************************************************/
アプリケーションウィンドウクラス
Definition AppWindow.h:28
画像サイズを表すクラス
Definition Image.h:67
モデルを生成、管理するクラス
Definition Model.h:98
シェーダープログラム統括クラス
Definition ShaderBinder.h:34
fk_ShaderBinder(void)
コンストラクタ1
void bindWindow(fk_AppWindow *window)
ウィンドウ連携設定関数2
fk_ShaderParameter * getParameter(void)
シェーダーパラメーター参照関数
void unbindWindow(fk_Window *window)
ウィンドウ連携解除メソッド1
void initializeFrameBufferObject(fk_Dimension dim)
フレームバッファーオブジェクト (FBO) 初期化関数2
void unbindModel(fk_Model *model)
シェーダーモデル連携解除関数
void bindWindow(fk_Window *window)
ウィンドウ連携設定関数1
void unbindWindow(fk_AppWindow *window)
ウィンドウ連携解除メソッド2
~fk_ShaderBinder()
デストラクタ
fk_ShaderProgram * getProgram(void)
シェーダープログラム参照関数
void bindModel(fk_Model *model)
シェーダーモデル連携設定関数
void initializeFrameBufferObject(int width, int height)
フレームバッファーオブジェクト (FBO) 初期化関数1
シェーダーパラメーター管理クラス
Definition ShaderParameter.h:19
シェーダープログラム格納クラス
Definition ShaderProgram.h:23
FLTK 用シーン描画ウィジェットクラス
Definition Window.h:120
Fine Kernel Toolkit 名前空間
Definition Angle.h:6