Beispiel #1
0
 /// <summary>
 /// Create a state block.
 /// </summary>
 /// <remarks>
 /// A state block is a collection of device state, and is used for saving and restoring device state. Use a state-block mask to enable subsets of state for saving and restoring. The <see cref="SharpDX.Direct3D10.StateBlockMask"/> structure can be filled manually or by using any of the D3D10StateBlockMaskXXX APIs. A state block mask can also be obtained by calling <see cref="SharpDX.Direct3D10.EffectTechnique.ComputeStateBlockMask"/> or <see cref="SharpDX.Direct3D10.EffectPass.ComputeStateBlockMask"/>.   Differences between Direct3D 9 and Direct3D 10: In Direct3D 10, a state block object does not contain any valid information about the state of the device until <see cref="SharpDX.Direct3D10.StateBlock.Capture"/> is called. In Direct3D 9, state is saved in a state block object, when it is created.   ?
 /// </remarks>
 /// <param name="device">The device for which the state block will be created. </param>
 /// <param name="mask">Indicates which parts of the device state will be captured when calling <see cref="SharpDX.Direct3D10.StateBlock.Capture"/> and reapplied when calling <see cref="SharpDX.Direct3D10.StateBlock.Apply"/>. See remarks. </param>
 /// <unmanaged>HRESULT D3D10CreateStateBlock([None] ID3D10Device* pDevice,[None] D3D10_STATE_BLOCK_MASK* pStateBlockMask,[None] ID3D10StateBlock** ppStateBlock)</unmanaged>
 public StateBlock(Device device, StateBlockMask mask)
 {
     D3D10.CreateStateBlock(device, ref mask, this);
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Effect"/> class.
 /// </summary>
 /// <param name="device">The device.</param>
 /// <param name="effectByteCode">The effect byte code.</param>
 /// <param name="fxFlags">Effect compile options</param>
 /// <param name="effectPool">Optional. A reference to an memory space for effect variables that are shared across effects (see <see cref="SharpDX.Direct3D10.EffectPool"/>).</param>
 public unsafe Effect(Device device, byte[] effectByteCode, EffectFlags fxFlags = EffectFlags.None, EffectPool effectPool = null)
 {
     fixed(void *ptr = effectByteCode)
     D3D10.CreateEffectFromMemory((IntPtr)ptr, effectByteCode.Length, (int)fxFlags, device, effectPool, this);
 }
Beispiel #3
0
 /// <summary>
 ///   This overload has been deprecated. Use one of the alternatives that does not take both an adapter and a driver type.
 /// </summary>
 internal static void CreateWithSwapChain(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, SwapChainDescription swapChainDescription, out Device device, out SwapChain swapChain)
 {
     D3D10.CreateDeviceAndSwapChain(adapter, driverType, IntPtr.Zero, flags, D3D10.SdkVersion,
                                    ref swapChainDescription, out swapChain, out device);
 }
Beispiel #4
0
 private void CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags)
 {
     D3D10.CreateDevice(adapter, driverType, IntPtr.Zero, flags, D3D10.SdkVersion, this);
 }
Beispiel #5
0
 private void CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel featureLevel)
 {
     D3D10.CreateDevice1(adapter, driverType, IntPtr.Zero, flags, featureLevel, D3D10.SdkVersion1, this);
 }