2 * Copyright (c) 2007-2010 SlimDX Group
\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
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\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
26 namespace Direct3D11
\r
28 ref class VertexShader;
\r
30 ref class ShaderResourceView;
\r
31 ref class SamplerState;
\r
32 ref class ClassInstance;
\r
35 /// Defines a wrapper for vertex shader related commands on the device.
\r
37 public ref class VertexShaderWrapper
\r
40 ID3D11DeviceContext* deviceContext;
\r
43 VertexShaderWrapper( ID3D11DeviceContext* device );
\r
47 /// Assigns a vertex shader to the device.
\r
49 /// <param name="shader">The shader to assign to the device. Assign null to disable the vertex shader.</param>
\r
50 void Set( VertexShader^ shader );
\r
53 /// Assigns a vertex shader to the device.
\r
55 /// <param name="shader">The shader to assign to the device. Assign <c>null</c> to disable the vertex shader.</param>
\r
56 /// <param name="classInstances">An array of class-instance interfaces. Each interface used by a shader must have a corresponding class instance or the shader will get disabled.</param>
\r
57 void Set( VertexShader^ shader, array<ClassInstance^>^ classInstances );
\r
60 /// Gets the vertex shader currently assigned to the device.
\r
62 /// <returns>The vertex shader (null if no shader is assigned).</returns>
\r
63 VertexShader^ Get();
\r
66 /// Gets the vertex shader currently assigned to the device.
\r
68 /// <param name="classInstances">An array that will be used to contain any class instances currently active.</param>
\r
69 /// <returns>The vertex shader (null if no shader is assigned).</returns>
\r
70 VertexShader^ Get( array<ClassInstance^>^ classInstances );
\r
73 /// Gets the constant buffers used by the vertex shader stage.
\r
75 /// <param name="startSlot">Index into the device's zero-based array from which to begin retrieving constant buffers.</param>
\r
76 /// <param name="count">Number of buffers to retrieve.</param>
\r
77 /// <returns>An array of constant buffers.</returns>
\r
78 array<Buffer^>^ GetConstantBuffers( int startSlot, int count );
\r
81 /// Gets the sampler states used by the vertex shader stage.
\r
83 /// <param name="startSlot">Index into the device's zero-based array from which to begin retrieving samplers.</param>
\r
84 /// <param name="count">Number of samplers to retrieve.</param>
\r
85 /// <returns>An array of sampler states.</returns>
\r
86 array<SamplerState^>^ GetSamplers( int startSlot, int count );
\r
89 /// Gets the shader resources used by the vertex shader stage.
\r
91 /// <param name="startSlot">Index into the device's zero-based array from which to begin retrieving shader resources.</param>
\r
92 /// <param name="count">Number of resources to retrieve.</param>
\r
93 /// <returns>An array of shader resources.</returns>
\r
94 array<ShaderResourceView^>^ GetShaderResources( int startSlot, int count );
\r
97 /// Sets a single constant buffer to be used by the vertex shader stage.
\r
99 /// <param name="slot">Index into the device's zero-based array to which to set the constant buffer.</param>
\r
100 void SetConstantBuffer( Buffer^ constantBuffer, int slot );
\r
103 /// Sets the constant buffers used by the vertex shader stage.
\r
105 /// <param name="startSlot">Index into the device's zero-based array to which to begin setting constant buffers.</param>
\r
106 /// <param name="count">Number of buffers from the source array to set.</param>
\r
107 void SetConstantBuffers( array<Buffer^>^ constantBuffers, int startSlot, int count );
\r
110 /// Sets a single sampler to be used by the vertex shader stage.
\r
112 /// <param name="slot">Index into the device's zero-based array to which to set the sampler.</param>
\r
113 void SetSampler( SamplerState^ sampler, int slot );
\r
116 /// Sets the sampler states used by the vertex shader stage.
\r
118 /// <param name="startSlot">Index into the device's zero-based array to which to begin setting samplers.</param>
\r
119 /// <param name="count">Number of samplers from the source array to set.</param>
\r
120 void SetSamplers( array<SamplerState^>^ samplers, int startSlot, int count );
\r
123 /// Sets a single shader resource to be used by the vertex shader stage.
\r
125 /// <param name="slot">Index into the device's zero-based array to which to set the resource.</param>
\r
126 void SetShaderResource( ShaderResourceView^ resourceView, int slot );
\r
129 /// Sets the shader resources used by the vertex shader stage.
\r
131 /// <param name="startSlot">Index into the device's zero-based array to which to begin setting shader resources.</param>
\r
132 /// <param name="count">Number of resources from the source array to set.</param>
\r
133 void SetShaderResources( array<ShaderResourceView^>^ resourceViews, int startSlot, int count );
\r