OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / direct3d9 / BaseEffect.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "../math/Color4.h"\r
25 #include "../math/Matrix.h"\r
26 #include "../math/Vector2.h"\r
27 #include "../math/Vector3.h"\r
28 #include "../math/Vector4.h"\r
29 \r
30 #include "Device.h"\r
31 #include "EffectHandle.h"\r
32 \r
33 #include "EffectDescription9.h"\r
34 #include "FunctionDescription.h"\r
35 #include "TechniqueDescription.h"\r
36 #include "PassDescription.h"\r
37 #include "ParameterDescription.h"\r
38 \r
39 namespace SlimDX\r
40 {\r
41         ref class DataStream;\r
42 \r
43         namespace Direct3D9\r
44         {\r
45                 /// <summary>\r
46                 /// Provides methods for getting and setting effect parameters such as constants, functions, shaders, and techniques.\r
47                 /// </summary>\r
48                 /// <unmanaged>ID3DXBaseEffect</unmanaged>\r
49                 public ref class BaseEffect abstract : public ComObject\r
50                 {\r
51                         COMOBJECT_BASE(ID3DXBaseEffect);\r
52 \r
53                 protected:\r
54                         /// <summary>\r
55                         /// Initializes a new instance of the <see cref="BaseEffect"/> class.\r
56                         /// </summary>\r
57                         BaseEffect() { }\r
58 \r
59                 public:\r
60                         /// <summary>\r
61                         /// Gets the handle of an annotation.\r
62                         /// </summary>\r
63                         /// <param name="handle">Handle of a technique, pass, or top-level parameter.</param>\r
64                         /// <param name="index">Annotation index.</param>\r
65                         /// <returns>The handle of the annotation.</returns>\r
66                         EffectHandle^ GetAnnotation( EffectHandle^ handle, int index );\r
67 \r
68                         /// <summary>\r
69                         /// Gets the handle of an annotation.\r
70                         /// </summary>\r
71                         /// <param name="handle">Handle of a technique, pass, or top-level parameter.</param>\r
72                         /// <param name="name">Name of the annotation.</param>\r
73                         /// <returns>The handle of the annotation.</returns>\r
74                         EffectHandle^ GetAnnotation( EffectHandle^ handle, System::String^ name );\r
75 \r
76                         /// <summary>\r
77                         /// Gets the handle of a parameter.\r
78                         /// </summary>\r
79                         /// <param name="parameter">Handle of the parameter, or <c>null</c> for top-level parameters.</param>\r
80                         /// <param name="index">Parameter index.</param>\r
81                         /// <returns>The handle of the parameter.</returns>\r
82                         EffectHandle^ GetParameter( EffectHandle^ parameter, int index );\r
83 \r
84                         /// <summary>\r
85                         /// Gets the handle of a parameter.\r
86                         /// </summary>\r
87                         /// <param name="parameter">Handle of the parameter, or <c>null</c> for top-level parameters.</param>\r
88                         /// <param name="name">Name of the parameter.</param>\r
89                         /// <returns>The handle of the parameter.</returns>\r
90                         EffectHandle^ GetParameter( EffectHandle^ parameter, System::String^ name );\r
91 \r
92                         /// <summary>\r
93                         /// Gets the handle of a parameter by looking up its semantic.\r
94                         /// </summary>\r
95                         /// <param name="parameter">Handle of the parameter, or <c>null</c> for top-level parameters.</param>\r
96                         /// <param name="name">The name of the semantic.</param>\r
97                         /// <returns>The handle of the parameter.</returns>\r
98                         EffectHandle^ GetParameterBySemantic( EffectHandle^ parameter, System::String^ name );\r
99 \r
100                         /// <summary>\r
101                         /// Gets the handle of an array element parameter.\r
102                         /// </summary>\r
103                         /// <param name="parameter">Handle of the array.</param>\r
104                         /// <param name="index">Array parameter index.</param>\r
105                         /// <returns>The handle of the parameter.</returns>\r
106                         EffectHandle^ GetParameterElement( EffectHandle^ parameter, int index );\r
107 \r
108                         /// <summary>\r
109                         /// Gets a parameter or annotation description.\r
110                         /// </summary>\r
111                         /// <param name="parameter">Handle of the parameter or annotation.</param>\r
112                         /// <returns>The description of the specified parameter or annotation.</returns>\r
113                         ParameterDescription GetParameterDescription( EffectHandle^ parameter );\r
114 \r
115                         /// <summary>\r
116                         /// Gets the handle of a function.\r
117                         /// </summary>\r
118                         /// <param name="index">Function index.</param>\r
119                         /// <returns>The handle of the function.</returns>\r
120                         EffectHandle^ GetFunction( int index );\r
121 \r
122                         /// <summary>\r
123                         /// Gets the handle of a function.\r
124                         /// </summary>\r
125                         /// <param name="name">Name of the function.</param>\r
126                         /// <returns>The handle of the function.</returns>\r
127                         EffectHandle^ GetFunction( System::String^ name );\r
128 \r
129                         /// <summary>\r
130                         /// Gets a function description.\r
131                         /// </summary>\r
132                         /// <param name="handle">Handle to the function.</param>\r
133                         /// <returns>The function description.</returns>\r
134                         FunctionDescription GetFunctionDescription( EffectHandle^ handle );\r
135 \r
136                         /// <summary>\r
137                         /// Gets the handle of a technique.\r
138                         /// </summary>\r
139                         /// <param name="index">Technique index.</param>\r
140                         /// <returns>The handle of the technique.</returns>\r
141                         EffectHandle^ GetTechnique( int index );\r
142 \r
143                         /// <summary>\r
144                         /// Gets the handle of a technique.\r
145                         /// </summary>\r
146                         /// <param name="name">Name of the technique.</param>\r
147                         /// <returns>The handle of the technique.</returns>\r
148                         EffectHandle^ GetTechnique( System::String^ name );\r
149 \r
150                         /// <summary>\r
151                         /// Gets a technique description.\r
152                         /// </summary>\r
153                         /// <param name="handle">Handle to the technique.</param>\r
154                         /// <returns>The technique description.</returns>\r
155                         TechniqueDescription GetTechniqueDescription( EffectHandle^ handle );\r
156 \r
157                         /// <summary>\r
158                         /// Gets the handle of a pass.\r
159                         /// </summary>\r
160                         /// <param name="technique">Handle of the parent technique.</param>\r
161                         /// <param name="index">Pass index.</param>\r
162                         /// <returns>The handle of the pass.</returns>\r
163                         EffectHandle^ GetPass( EffectHandle^ technique, int index );\r
164 \r
165                         /// <summary>\r
166                         /// Gets the handle of a pass.\r
167                         /// </summary>\r
168                         /// <param name="technique">Handle of the parent technique.</param>\r
169                         /// <param name="name">Name of the pass.</param>\r
170                         /// <returns>The handle of the pass.</returns>\r
171                         EffectHandle^ GetPass( EffectHandle^ technique, System::String^ name );\r
172 \r
173                         /// <summary>\r
174                         /// Gets the description of a pass.\r
175                         /// </summary>\r
176                         /// <param name="handle">Handle to the pass.</param>\r
177                         /// <returns>The pass description.</returns>\r
178                         PassDescription GetPassDescription( EffectHandle^ handle );\r
179                         \r
180                         /// <summary>\r
181                         /// Gets the value of the specified parameter.\r
182                         /// </summary>\r
183                         /// <param name="parameter">Handle of the parameter.</param>\r
184                         /// <returns>The value of the parameter.</returns>\r
185                         generic<typename T> where T : value class\r
186                                 T GetValue( EffectHandle^ parameter );\r
187 \r
188                         /// <summary>\r
189                         /// Gets the value of the specified parameter.\r
190                         /// </summary>\r
191                         /// <param name="parameter">Handle of the parameter.</param>\r
192                         /// <returns>The value of the parameter.</returns>\r
193                         generic<typename T> where T : value class\r
194                                 array<T>^ GetValue( EffectHandle^ parameter, int count );\r
195 \r
196                         /// <summary>\r
197                         /// Sets the value of a parameter using the specified data.\r
198                         /// </summary>\r
199                         /// <param name="parameter">The parameter whose value is to be set.</param>\r
200                         /// <param name="value">The new value for the parameter.</param>\r
201                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
202                         generic<typename T> where T : value class\r
203                                 Result SetValue( EffectHandle^ parameter, T value );\r
204 \r
205                         /// <summary>\r
206                         /// Sets the value of a parameter using the specified data.\r
207                         /// </summary>\r
208                         /// <param name="parameter">The array parameter whose value is to be set.</param>\r
209                         /// <param name="values">The array of new values for the array parameter.</param>\r
210                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
211                         generic<typename T> where T : value class\r
212                                 Result SetValue( EffectHandle^ parameter, array<T>^ values );\r
213 \r
214                         /// <summary>\r
215                         /// Gets the value of the specified parameter as a texture.\r
216                         /// </summary>\r
217                         /// <param name="parameter">Handle of the parameter.</param>\r
218                         /// <returns>The texture value of the parameter.</returns>\r
219                         BaseTexture^ GetTexture( EffectHandle^ parameter );\r
220 \r
221                         /// <summary>\r
222                         /// Sets the value of a parameter using the specified data.\r
223                         /// </summary>\r
224                         /// <param name="parameter">The parameter whose value is to be set.</param>\r
225                         /// <param name="value">The new value for the parameter.</param>\r
226                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
227                         Result SetTexture( EffectHandle^ parameter, BaseTexture^ value );\r
228 \r
229                         /// <summary>\r
230                         /// Gets the value of the specified parameter as a string.\r
231                         /// </summary>\r
232                         /// <param name="parameter">Handle of the parameter.</param>\r
233                         /// <returns>The string value of the parameter.</returns>\r
234                         System::String^ GetString( EffectHandle^ parameter );\r
235 \r
236                         /// <summary>\r
237                         /// Sets the value of a parameter using the specified data.\r
238                         /// </summary>\r
239                         /// <param name="parameter">The parameter whose value is to be set.</param>\r
240                         /// <param name="value">The new value for the parameter.</param>\r
241                         /// <returns>A <see cref="SlimDX::Result"/> object describing the result of the operation.</returns>\r
242                         Result SetString( EffectHandle^ parameter, System::String^ value );\r
243 \r
244                         /// <summary>\r
245                         /// Gets a pixel shader from the effect.\r
246                         /// </summary>\r
247                         /// <param name="parameter">The effect parameter identifying the shader.</param>\r
248                         /// <returns>The requested pixel shader.</returns>\r
249                         PixelShader^ GetPixelShader( EffectHandle^ parameter );\r
250 \r
251                         /// <summary>\r
252                         /// Gets a vertex shader from the effect.\r
253                         /// </summary>\r
254                         /// <param name="parameter">The effect parameter identifying the shader.</param>\r
255                         /// <returns>The requested vertex shader.</returns>\r
256                         VertexShader^ GetVertexShader( EffectHandle^ parameter );\r
257 \r
258                         /// <summary>\r
259                         /// Gets the effect description.\r
260                         /// </summary>\r
261                         property EffectDescription Description\r
262                         {\r
263                                 EffectDescription get();\r
264                         }\r
265                 };\r
266    }\r
267 }\r