FineKernelToolKit  3.1.0
ShaderParameter.h
[詳解]
1 #pragma once
2 
3 #include "TextureSampler.h"
4 
5 using namespace System;
6 using namespace System::Collections::Generic;
7 using namespace FK_CLI;
8 
9 namespace FK_ShaderPlugin
10 {
12 
21  public ref class fk_ShaderParameter
22  {
23  public:
26 
28  virtual ~fk_ShaderParameter();
29 
31 
35  property String^ LastError { String^ get(void); };
36 
38 
48  void Register(String^ name, float value);
49 
51 
63  void Register(String^ name, array<float>^ value);
64 
66 
76  void Register(String^ name, int value);
77 
79 
91  void Register(String^ name, array<int>^ value);
92 
94 
106  void Register(String^ name, fk_Matrix^ value);
107 
109 
119  bool Unregister(String^ name);
120 
122 
138  void AddAttribute(String^ name, int dim, array<float>^ value);
139 
141 
157  void AddAttribute(String^ name, int dim, array<int>^ value);
158 
160 
170  bool RemoveAttribute(String^ name);
171 
173 
193  bool AttachTexture(int unit, fk_TextureSampler^ texture);
194 
196 
205  bool DetachTexture(int unit);
206 
207  internal:
208  bool Apply(UInt32 programId);
209 
210  private:
211  Int32 GetLocation(UInt32 programId, String^ name);
212  Int32 GetAttributeLocation(UInt32 programId, String^ name);
213 
214  Dictionary<String^, float>^ floatTable;
215  Dictionary<String^, array<float>^>^ floatArrayTable;
216  Dictionary<String^, int>^ intTable;
217  Dictionary<String^, array<int>^>^ intArrayTable;
218  Dictionary<String^, fk_Matrix^>^ matrixTable;
219  Dictionary<String^, Int32>^ locationTable;
220 
221  Dictionary<String^, Tuple<int, array<float>^>^>^ floatAttributeTable;
222  Dictionary<String^, Tuple<int, array<int>^>^>^ intAttributeTable;
223  Dictionary<String^, Int32>^ attributeLocationTable;
224 
225  Dictionary<int, fk_TextureSampler^>^ textureTable;
226 
227  String^ lastError;
228  UInt32 lastAppliedId;
229  };
230 }
231 
232 /****************************************************************************
233  *
234  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
235  *
236  * Redistribution and use in source and binary forms,
237  * with or without modification, are permitted provided that the
238  * following conditions are met:
239  *
240  * - Redistributions of source code must retain the above
241  * copyright notice, this list of conditions and the
242  * following disclaimer.
243  *
244  * - Redistributions in binary form must reproduce the above
245  * copyright notice, this list of conditions and the
246  * following disclaimer in the documentation and/or
247  * other materials provided with the distribution.
248  *
249  * - Neither the name of the copyright holders nor the names
250  * of its contributors may be used to endorse or promote
251  * products derived from this software without specific
252  * prior written permission.
253  *
254  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
255  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
256  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
257  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
258  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
259  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
260  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
261  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
262  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
263  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
264  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
265  * POSSIBILITY OF SUCH DAMAGE.
266  *
267  ****************************************************************************/
268 /****************************************************************************
269  *
270  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
271  *
272  * 本ソフトウェアおよびソースコードのライセンスは、基本的に
273  * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
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  * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
299  * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
300  * ついて、一切責任を負わないものとします。
301  *
302  ****************************************************************************/
Definition: ShaderBinder.h:9
4元正方行列を管理するクラス
Definition: Matrix_CLI.h:108
シェーダー入出力テクスチャークラス
Definition: TextureSampler.h:42
シェーダーパラメーター管理クラス
Definition: ShaderParameter.h:21
Definition: AppWindow_CLI.h:11