本文整理汇总了C#中SharpDX.__MarshalFree方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.__MarshalFree方法的具体用法?C# SharpDX.__MarshalFree怎么用?C# SharpDX.__MarshalFree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX
的用法示例。
在下文中一共展示了SharpDX.__MarshalFree方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: X3DAudioCalculate
/// <summary>
/// <p>Calculates DSP settings with respect to 3D parameters.</p>
/// </summary>
/// <param name="instance"><dd> <p>3D audio instance handle. Call <strong><see cref="SharpDX.X3DAudio.X3DAudio.X3DAudioInitialize"/></strong> to get this handle.</p> </dd></param>
/// <param name="listenerRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.Listener"/></strong> representing the point of reception.</p> </dd></param>
/// <param name="emitterRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.Emitter"/></strong> representing the sound source.</p> </dd></param>
/// <param name="flags"><dd> <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/></td><td>Enables matrix coefficient table calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Delay"/></td><td>Enables delay time array calculation (stereo only).?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.LpfDirect"/></td><td>Enables low pass filter (LPF) direct-path coefficient calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.LpfReverb"/></td><td>Enables LPF reverb-path coefficient calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Reverb"/></td><td>Enables reverb send level calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.Doppler"/></td><td>Enables Doppler shift factor calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.EmitterAngle"/></td><td>Enables emitter-to-listener interior angle calculation.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.ZeroCenter"/></td><td>Fills the center channel with silence. This flag allows you to keep a 6-channel matrix so you do not have to remap the channels, but the center channel will be silent. This flag is only valid if you also set <see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/>.?</td></tr> <tr><td><see cref="SharpDX.X3DAudio.CalculateFlags.RedirectToLfe"/></td><td> Applies an equal mix of all source channels to a low frequency effect (LFE) destination channel. It only applies to matrix calculations with a source that does not have an LFE channel and a destination that does have an LFE channel. This flag is only valid if you also set <see cref="SharpDX.X3DAudio.CalculateFlags.Matrix"/>.?</td></tr> </table> <p>?</p> </dd></param>
/// <param name="dSPSettingsRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.X3DAudio.DspSettings"/></strong> structure that receives the calculation results.</p> </dd></param>
/// <remarks>
/// <p>You typically call <strong><see cref="SharpDX.X3DAudio.X3DAudio.X3DAudioCalculate"/></strong> once for each pair of emitting objects and listeners in the scene. After each call, to apply the 3D effects, the app manually applies the calculation results at <em>pDSPSettings</em> to the XAUDIO2 graph. For more info, see How to: Integrate X3DAudio with XAudio2.</p><p><strong>Important</strong>?? The listener and emitter values must be valid. Floating-point specials (NaN, QNaN, +INF, -INF) can cause the entire audio output to go silent if introduced into a running audio graph.</p>
/// </remarks>
/// <include file='..\..\Documentation\CodeComments.xml' path="/comments/comment[@id='X3DAudioCalculate']/*"/>
/// <msdn-id>microsoft.directx_sdk.x3daudio.x3daudiocalculate</msdn-id>
/// <unmanaged>void X3DAudioCalculate([In] const X3DAUDIOHANDLE* Instance,[In] const X3DAUDIO_LISTENER* pListener,[In] const X3DAUDIO_EMITTER* pEmitter,[In] X3DAudioCalculateFlags Flags,[In] void* pDSPSettings)</unmanaged>
/// <unmanaged-short>X3DAudioCalculate</unmanaged-short>
public static void X3DAudioCalculate(ref SharpDX.X3DAudio.X3DAudioHandle instance, SharpDX.X3DAudio.Listener listenerRef, SharpDX.X3DAudio.Emitter emitterRef, SharpDX.X3DAudio.CalculateFlags flags, System.IntPtr dSPSettingsRef) {
unsafe {
var listenerRef_ = new SharpDX.X3DAudio.Listener.__Native();
listenerRef.__MarshalTo(ref listenerRef_);
var emitterRef_ = new SharpDX.X3DAudio.Emitter.__Native();
emitterRef.__MarshalTo(ref emitterRef_);
fixed (void* instance_ = &instance)
X3DAudioCalculate_(instance_, &listenerRef_, &emitterRef_, unchecked((int)flags), (void*)dSPSettingsRef);
listenerRef.__MarshalFree(ref listenerRef_);
emitterRef.__MarshalFree(ref emitterRef_);
}
}
示例2: CreateCaptureBuffer
/// <summary>
/// The CreateCaptureBuffer method creates a buffer for capturing waveform audio.
/// </summary>
/// <param name="cDSCBufferDescRef"><dd> Pointer to a <see cref="SharpDX.DirectSound.CaptureBufferDescription"/> structure containing values for the capture buffer being created. </dd></param>
/// <param name="dSCBufferOut"><dd> Address of a variable that receives an <see cref="SharpDX.DirectSound.CaptureBufferBase"/> interface reference. Use QueryInterface to obtain <see cref="SharpDX.DirectSound.CaptureBuffer"/>. See Remarks. </dd></param>
/// <param name="unkOuterRef"><dd> Address of the controlling object's <see cref="SharpDX.ComObject"/> interface for COM aggregation. Must be <c>null</c>. </dd></param>
/// <returns><p>If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values.</p> <table> <tr><td>Return code</td></tr> <tr><td>DSERR_INVALIDPARAM </td></tr> <tr><td>DSERR_BADFORMAT </td></tr> <tr><td>DSERR_GENERIC </td></tr> <tr><td>DSERR_NODRIVER </td></tr> <tr><td>DSERR_OUTOFMEMORY </td></tr> <tr><td>DSERR_UNINITIALIZED </td></tr> </table></returns>
/// <remarks>
/// <p>On Microsoft Windows98 and Windows2000, each capture device supports a single buffer.</p> <p>The <see cref="SharpDX.DirectSound.CaptureBuffer"/> interface is supported only on buffers created by an object of class CLSID_DirectSoundCapture8. If the IDirectSoundCapture8 interface was obtained from DirectSoundCaptureCreate8, <see cref="SharpDX.DirectSound.CaptureBuffer"/> is supported. If IDirectSoundCapture8 was obtained from the earlier DirectSoundCaptureCreate function, only <see cref="SharpDX.DirectSound.CaptureBufferBase"/> is supported.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectSoundCapture::CreateCaptureBuffer']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectsoundcapture8.idirectsoundcapture8.createcapturebuffer</msdn-id>
/// <unmanaged>HRESULT IDirectSoundCapture::CreateCaptureBuffer([In] const DSCBUFFERDESC* pcDSCBufferDesc,[Out] IDirectSoundCaptureBuffer** ppDSCBuffer,[In] IUnknown* pUnkOuter)</unmanaged>
/// <unmanaged-short>IDirectSoundCapture::CreateCaptureBuffer</unmanaged-short>
internal void CreateCaptureBuffer(SharpDX.DirectSound.CaptureBufferDescription cDSCBufferDescRef, out SharpDX.DirectSound.CaptureBufferBase dSCBufferOut, SharpDX.ComObject unkOuterRef) {
unsafe {
var cDSCBufferDescRef_ = SharpDX.DirectSound.CaptureBufferDescription.__NewNative();
cDSCBufferDescRef.__MarshalTo(ref cDSCBufferDescRef_);
IntPtr dSCBufferOut_ = IntPtr.Zero;
SharpDX.Result __result__;
__result__=
SharpDX.DirectSound.LocalInterop.Calliint(_nativePointer, &cDSCBufferDescRef_, &dSCBufferOut_, (void*)((unkOuterRef == null)?IntPtr.Zero:unkOuterRef.NativePointer),((void**)(*(void**)_nativePointer))[3]);
cDSCBufferDescRef.__MarshalFree(ref cDSCBufferDescRef_);
dSCBufferOut= (dSCBufferOut_ == IntPtr.Zero)?null:new SharpDX.DirectSound.CaptureBufferBase(dSCBufferOut_);
__result__.CheckError();
}
}
示例3: CreateFontIndirect
/// <summary>
/// <p>Creates a font object.</p><p><strong>Note</strong>??Instead of using this function, we recommend that you use DirectWrite and the DirectXTK library, <strong>SpriteFont</strong> class. </p>
/// </summary>
/// <param name="deviceRef">No documentation.</param>
/// <param name="descRef">No documentation.</param>
/// <param name="fontOut">No documentation.</param>
/// <returns><p>The return value is one of the values listed in Direct3D 10 Return Codes.</p></returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DX10CreateFontIndirectW']/*"/>
/// <msdn-id>bb172665</msdn-id>
/// <unmanaged>HRESULT D3DX10CreateFontIndirectW([In] ID3D10Device* pDevice,[In] const D3DX10_FONT_DESCW* pDesc,[Out, Fast] ID3DX10Font** ppFont)</unmanaged>
/// <unmanaged-short>D3DX10CreateFontIndirectW</unmanaged-short>
public static void CreateFontIndirect(SharpDX.Direct3D10.Device deviceRef, ref SharpDX.Direct3D10.FontDescription descRef, SharpDX.Direct3D10.Font fontOut) {
unsafe {
var descRef_ = new SharpDX.Direct3D10.FontDescription.__Native();
descRef.__MarshalTo(ref descRef_);
IntPtr fontOut_ = IntPtr.Zero;
SharpDX.Result __result__;
__result__=
D3DX10CreateFontIndirectW_((void*)((deviceRef == null)?IntPtr.Zero:deviceRef.NativePointer), &descRef_, &fontOut_);
descRef.__MarshalFree(ref descRef_);
((SharpDX.Direct3D10.Font)fontOut).NativePointer = fontOut_;
__result__.CheckError();
}
}
示例4: FrameNumNamedMatrices
/// <summary>
/// <p>Counts number of frames in a subtree that have non-null names.</p>
/// </summary>
/// <param name="frameRootRef"><dd> <p>Pointer to the root node of the subtree.</p> </dd></param>
/// <returns><p>Returns the frame count.</p></returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXFrameNumNamedMatrices']/*"/>
/// <msdn-id>bb172850</msdn-id>
/// <unmanaged>unsigned int D3DXFrameNumNamedMatrices([In] const D3DXFRAME* pFrameRoot)</unmanaged>
/// <unmanaged-short>D3DXFrameNumNamedMatrices</unmanaged-short>
public static int FrameNumNamedMatrices(ref SharpDX.Direct3D9.Frame frameRootRef) {
unsafe {
var frameRootRef_ = new SharpDX.Direct3D9.Frame.__Native();
frameRootRef.__MarshalTo(ref frameRootRef_);
int __result__;
__result__=
D3DXFrameNumNamedMatrices_(&frameRootRef_);
frameRootRef.__MarshalFree(ref frameRootRef_);
return __result__;
}
}
示例5: FrameFind
/// <summary>
/// <p>Finds the child frame of a root frame.</p>
/// </summary>
/// <param name="frameRootRef"><dd> <p>Pointer to the root frame. See <strong><see cref="SharpDX.Direct3D9.Frame"/></strong>.</p> </dd></param>
/// <param name="name"><dd> <p>Name of the child frame to find.</p> </dd></param>
/// <returns><p>Returns the child frame if it is found, or <strong><c>null</c></strong> otherwise. See <strong><see cref="SharpDX.Direct3D9.Frame"/></strong>.</p></returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXFrameFind']/*"/>
/// <msdn-id>bb172849</msdn-id>
/// <unmanaged>D3DXFRAME* D3DXFrameFind([In] const D3DXFRAME* pFrameRoot,[In] const char* Name)</unmanaged>
/// <unmanaged-short>D3DXFrameFind</unmanaged-short>
public static SharpDX.Direct3D9.Frame FrameFind(ref SharpDX.Direct3D9.Frame frameRootRef, string name) {
unsafe {
var frameRootRef_ = new SharpDX.Direct3D9.Frame.__Native();
frameRootRef.__MarshalTo(ref frameRootRef_);
IntPtr name_ = Utilities.StringToHGlobalAnsi(name);
SharpDX.Direct3D9.Frame __result__;
__result__=
D3DXFrameFind_(&frameRootRef_, (void*)name_);
frameRootRef.__MarshalFree(ref frameRootRef_);
Marshal.FreeHGlobal(name_ );
return __result__;
}
}
示例6: SaveMeshHierarchyToFileW
/// <summary>
/// <p>Creates a .x file and saves the mesh hierarchy and corresponding animations in it.</p>
/// </summary>
/// <param name="filename"><dd> <p>Pointer to a string that specifies the name of the .x file identifying the saved mesh. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.</p> </dd></param>
/// <param name="xFormat"><dd> <p>Format of the .x file (text or binary, compressed or not). See <see cref="SharpDX.Direct3D9.XFileFormat"/>. <see cref="SharpDX.Direct3D9.XFileFormat.Compressed"/> can be combined (using a logical OR) with either the <see cref="SharpDX.Direct3D9.XFileFormat.Binary"/> or <see cref="SharpDX.Direct3D9.XFileFormat.Text"/> flags to reduce the output file size.</p> </dd></param>
/// <param name="frameRootRef"><dd> <p>Root node of the hierarchy to be saved. See <strong><see cref="SharpDX.Direct3D9.Frame"/></strong>.</p> </dd></param>
/// <param name="animControllerRef"><dd> <p>Animation controller that has animation sets to be stored. See <strong><see cref="SharpDX.Direct3D9.AnimationController"/></strong>.</p> </dd></param>
/// <param name="userDataSaverRef"><dd> <p>Application-provided interface that allows saving of user data. See <strong><see cref="SharpDX.Direct3D9.ISaveUserData"/></strong>.</p> </dd></param>
/// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. If the function fails, the return value can be: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>.</p></returns>
/// <remarks>
/// <p>The compiler setting also determines the function version. If Unicode is defined, the function call resolves to <see cref="SharpDX.Direct3D9.D3DX9.SaveMeshHierarchyToFileW"/>. Otherwise, the function call resolves to D3DXSaveMeshHierarchyToFileA.</p><p>This function does not save compressed animation sets.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXSaveMeshHierarchyToFileW']/*"/>
/// <msdn-id>bb205427</msdn-id>
/// <unmanaged>HRESULT D3DXSaveMeshHierarchyToFileW([In] const wchar_t* Filename,[In] unsigned int XFormat,[In] const D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController,[In] ID3DXSaveUserData* pUserDataSaver)</unmanaged>
/// <unmanaged-short>D3DXSaveMeshHierarchyToFileW</unmanaged-short>
public static void SaveMeshHierarchyToFileW(string filename, int xFormat, ref SharpDX.Direct3D9.Frame frameRootRef, SharpDX.Direct3D9.AnimationController animControllerRef, SharpDX.Direct3D9.ISaveUserData userDataSaverRef) {
unsafe {
IntPtr filename_ = Utilities.StringToHGlobalUni(filename);
var frameRootRef_ = new SharpDX.Direct3D9.Frame.__Native();
frameRootRef.__MarshalTo(ref frameRootRef_);
SharpDX.Result __result__;
__result__=
D3DXSaveMeshHierarchyToFileW_((void*)filename_, xFormat, &frameRootRef_, (void*)((animControllerRef == null)?IntPtr.Zero:animControllerRef.NativePointer), (void*)((userDataSaverRef == null)?IntPtr.Zero:userDataSaverRef.NativePointer));
Marshal.FreeHGlobal(filename_ );
frameRootRef.__MarshalFree(ref frameRootRef_);
__result__.CheckError();
}
}
示例7: FrameRegisterNamedMatrices
/// <summary>
/// <p>Given a frame hierarchy, registers all the named matrices in the animation mixer.</p>
/// </summary>
/// <param name="frameRootRef"><dd> <p>The top level node in the frame hierarchy.</p> </dd></param>
/// <param name="animControllerRef"><dd> <p>Pointer to the animation controller object.</p> </dd></param>
/// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. If the function fails, the return value can be one of the following values: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>, E_OUTOFMEMORY.</p></returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXFrameRegisterNamedMatrices']/*"/>
/// <msdn-id>bb172851</msdn-id>
/// <unmanaged>HRESULT D3DXFrameRegisterNamedMatrices([In] D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController)</unmanaged>
/// <unmanaged-short>D3DXFrameRegisterNamedMatrices</unmanaged-short>
public static void FrameRegisterNamedMatrices(ref SharpDX.Direct3D9.Frame frameRootRef, SharpDX.Direct3D9.AnimationController animControllerRef) {
unsafe {
var frameRootRef_ = new SharpDX.Direct3D9.Frame.__Native();
frameRootRef.__MarshalTo(ref frameRootRef_);
SharpDX.Result __result__;
__result__=
D3DXFrameRegisterNamedMatrices_(&frameRootRef_, (void*)((animControllerRef == null)?IntPtr.Zero:animControllerRef.NativePointer));
frameRootRef.__MarshalFree(ref frameRootRef_);
__result__.CheckError();
}
}
示例8: SimplifyMesh
/// <summary>
/// <p>Generates a simplified mesh using the provided weights that come as close as possible to the given MinValue.</p>
/// </summary>
/// <param name="meshRef"><dd> <p>Pointer to an <strong><see cref="SharpDX.Direct3D9.Mesh"/></strong> interface, representing the source mesh.</p> </dd></param>
/// <param name="adjacencyRef"><dd> <p>Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.</p> </dd></param>
/// <param name="vertexAttributeWeightsRef"><dd> <p>Pointer to a <strong><see cref="SharpDX.Direct3D9.AttributeWeights"/></strong> structure, containing the weight for each vertex component. If this parameter is set to <strong><c>null</c></strong>, a default structure is used. See Remarks.</p> </dd></param>
/// <param name="vertexWeightsRef"><dd> <p>Pointer to an array of vertex weights. If this parameter is set to <strong><c>null</c></strong>, all vertex weights are set to 1.0.</p> </dd></param>
/// <param name="minValue"><dd> <p>Number of vertices or faces, depending on the flag set in the <em>Options</em> parameter, by which to simplify the source mesh.</p> </dd></param>
/// <param name="options"><dd> <p>Specifies simplification options for the mesh. One of the flags in <strong>D3DXMESHSIMP</strong> can be set.</p> </dd></param>
/// <param name="meshOut"><dd> <p>Address of a reference to an <strong><see cref="SharpDX.Direct3D9.Mesh"/></strong> interface, representing the returned simplification mesh.</p> </dd></param>
/// <returns><p>If the function succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. If the function fails, the return value can be one of the following: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.</p></returns>
/// <remarks>
/// <p>This function generates a mesh that has <em>MinValue</em> vertices or faces.</p><p>If the simplification process cannot reduce the mesh to <em>MinValue</em>, the call still succeeds because <em>MinValue</em> is a desired minimum, not an absolute minimum.</p><p>If <em>pVertexAttributeWeights</em> is set to <strong><c>null</c></strong>, the following values are assigned to the default <strong><see cref="SharpDX.Direct3D9.AttributeWeights"/></strong> structure.</p><pre> <see cref="SharpDX.Direct3D9.AttributeWeights"/> AttributeWeights; AttributeWeights.Position = 1.0;
/// AttributeWeights.Boundary = 1.0;
/// AttributeWeights.Normal = 1.0;
/// AttributeWeights.Diffuse = 0.0;
/// AttributeWeights.Specular = 0.0;
/// AttributeWeights.Tex[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
/// </pre><p>This default structure is what most applications should use because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified. </p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXSimplifyMesh']/*"/>
/// <msdn-id>bb205463</msdn-id>
/// <unmanaged>HRESULT D3DXSimplifyMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXMesh** ppMesh)</unmanaged>
/// <unmanaged-short>D3DXSimplifyMesh</unmanaged-short>
public static void SimplifyMesh(SharpDX.Direct3D9.Mesh meshRef, int adjacencyRef, ref SharpDX.Direct3D9.AttributeWeights vertexAttributeWeightsRef, float vertexWeightsRef, int minValue, int options, out SharpDX.Direct3D9.Mesh meshOut) {
unsafe {
var vertexAttributeWeightsRef_ = new SharpDX.Direct3D9.AttributeWeights.__Native();
vertexAttributeWeightsRef.__MarshalTo(ref vertexAttributeWeightsRef_);
IntPtr meshOut_ = IntPtr.Zero;
SharpDX.Result __result__;
__result__=
D3DXSimplifyMesh_((void*)((meshRef == null)?IntPtr.Zero:meshRef.NativePointer), &adjacencyRef, &vertexAttributeWeightsRef_, &vertexWeightsRef, minValue, options, &meshOut_);
vertexAttributeWeightsRef.__MarshalFree(ref vertexAttributeWeightsRef_);
meshOut= (meshOut_ == IntPtr.Zero)?null:new SharpDX.Direct3D9.Mesh(meshOut_);
__result__.CheckError();
}
}
示例9: CreateEffect
/// <summary>
/// Creates and initializes an instance of an effect identified by the effect globally unique identifier (<see cref="System.Guid"/>).
/// </summary>
/// <param name="arg0"><dd> Reference to (C++) or address of (C) the <see cref="System.Guid"/> identifying the effect to be created. This can be a predefined effect <see cref="System.Guid"/>, or it can be a <see cref="System.Guid"/> obtained from <see cref="SharpDX.DirectInput.Device.EnumEffects"/>. The following standard effect GUIDs are defined: <ul> <li><p><see cref="SharpDX.DirectInput.EffectGuid.ConstantForce"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.RampForce"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Square"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Sine"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Triangle"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.SawtoothUp"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.SawtoothDown"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Spring"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Damper"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Inertia"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.Friction"/> </p></li> <li><p><see cref="SharpDX.DirectInput.EffectGuid.CustomForce"/> </p></li> </ul> </dd></param>
/// <param name="arg1"><dd> <see cref="SharpDX.DirectInput.EffectParameters"/> structure that provides parameters for the created effect. This parameter is optional. If it is <c>null</c>, the effect object is created without parameters. The application must then call the <see cref="SharpDX.DirectInput.Effect.SetParameters"/> method to set the parameters of the effect before it can download the effect. </dd></param>
/// <param name="arg2"><dd> Address of a variable to receive a reference to the <see cref="SharpDX.DirectInput.Effect"/> Interface interface if successful. </dd></param>
/// <param name="arg3"><dd> Controlling unknown for COM aggregation. The value is <c>null</c> if the interface is not aggregated. Most calling applications pass <c>null</c>. </dd></param>
/// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.DirectInput.ResultCode.Ok"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.DeviceFull"/>, <see cref="SharpDX.DirectInput.ResultCode.DeviceNotRegistered"/>,<see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.NotInitialized"/>.</p></returns>
/// <remarks>
/// <p>If the return value is <see cref="SharpDX.Result.Ok"/>, the effect was created, and the parameters of the effect were updated, but the effect was not necessarily downloaded. For it to be downloaded, the device must be acquired in exclusive mode.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputDevice8W::CreateEffect']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.createeffect</msdn-id>
/// <unmanaged>HRESULT IDirectInputDevice8W::CreateEffect([In] const GUID& arg0,[In] const DIEFFECT* arg1,[Out, Fast] IDirectInputEffect** arg2,[In] IUnknown* arg3)</unmanaged>
/// <unmanaged-short>IDirectInputDevice8W::CreateEffect</unmanaged-short>
internal void CreateEffect(System.Guid arg0, SharpDX.DirectInput.EffectParameters arg1, SharpDX.DirectInput.Effect arg2, SharpDX.ComObject arg3) {
unsafe {
var arg1_ = SharpDX.DirectInput.EffectParameters.__NewNative();
arg1.__MarshalTo(ref arg1_);
IntPtr arg2_ = IntPtr.Zero;
SharpDX.Result __result__;
__result__=
SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0, &arg1_, &arg2_, (void*)((arg3 == null)?IntPtr.Zero:arg3.NativePointer),((void**)(*(void**)_nativePointer))[18]);
arg1.__MarshalFree(ref arg1_);
((SharpDX.DirectInput.Effect)arg2).NativePointer = arg2_;
__result__.CheckError();
}
}
示例10: SetDataFormat
/// <summary>
/// Sets the data format for the DirectInput device.
/// </summary>
/// <param name="arg0"><dd> Address of a structure that describes the format of the data that the DirectInputDevice should return. An application can define its own <see cref="SharpDX.DirectInput.DataFormat"/> structure or use one of the following predefined global variables: <ul> <li><p> c_dfDIKeyboard </p></li> <li><p> c_dfDIMouse </p></li> <li><p> c_dfDIMouse2 </p></li> <li><p> c_dfDIJoystick </p></li> <li><p> c_dfDIJoystick2 </p></li> </ul> </dd></param>
/// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.DirectInput.ResultCode.Ok"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.Acquired"/>, <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.NotInitialized"/>.</p></returns>
/// <remarks>
/// <p>The data format must be set before the device can be acquired by using the <see cref="SharpDX.DirectInput.Device"/> Interface method. It is necessary to set the data format only once. The data format cannot be changed while the device is acquired.</p> <p>If the application is using action mapping, the data format is set instead by the call to <see cref="SharpDX.DirectInput.Device.SetActionMap"/>.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputDevice8W::SetDataFormat']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setdataformat</msdn-id>
/// <unmanaged>HRESULT IDirectInputDevice8W::SetDataFormat([In] const DIDATAFORMAT* arg0)</unmanaged>
/// <unmanaged-short>IDirectInputDevice8W::SetDataFormat</unmanaged-short>
internal void SetDataFormat(SharpDX.DirectInput.DataFormat arg0) {
unsafe {
var arg0_ = SharpDX.DirectInput.DataFormat.__NewNative();
arg0.__MarshalTo(ref arg0_);
SharpDX.Result __result__;
__result__=
SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0_,((void**)(*(void**)_nativePointer))[11]);
arg0.__MarshalFree(ref arg0_);
__result__.CheckError();
}
}
示例11: SetParameters
/// <summary>
/// No documentation.
/// </summary>
/// <param name="arg0">No documentation.</param>
/// <param name="arg1">No documentation.</param>
/// <returns>No documentation.</returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputEffect::SetParameters']/*"/>
/// <unmanaged>HRESULT IDirectInputEffect::SetParameters([In] const DIEFFECT* arg0,[In] DIEP arg1)</unmanaged>
/// <unmanaged-short>IDirectInputEffect::SetParameters</unmanaged-short>
public void SetParameters(SharpDX.DirectInput.EffectParameters arg0, SharpDX.DirectInput.EffectParameterFlags arg1) {
unsafe {
var arg0_ = SharpDX.DirectInput.EffectParameters.__NewNative();
arg0.__MarshalTo(ref arg0_);
SharpDX.Result __result__;
__result__=
SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0_, unchecked((int)arg1),((void**)(*(void**)_nativePointer))[6]);
arg0.__MarshalFree(ref arg0_);
__result__.CheckError();
}
}
示例12: EnumDevicesBySemantics
/// <summary>
/// Enumerates devices that most closely match the application-specified action map.
/// </summary>
/// <param name="arg0"><dd> String identifying the current user, or <c>null</c> to specify the user logged onto the system. The user name is taken into account when enumerating devices. A device with user mappings is preferred to a device without any user mappings. By default, devices in use by other users are not enumerated for this user. </dd></param>
/// <param name="arg1"><dd> Address of a <see cref="SharpDX.DirectInput.ActionFormat"/> structure that specifies the action map for which suitable devices are enumerated. </dd></param>
/// <param name="arg2"><dd> Address of a callback function to be called once for each device enumerated. See DIEnumDevicesBySemanticsCallback. </dd></param>
/// <param name="arg3"><dd> Application-defined 32-bit value to pass to the enumeration callback each time it is called. </dd></param>
/// <param name="arg4"><dd> Flag value that specifies the scope of the enumeration. This parameter can be one or more of the following values. <dl> <dt>DIEDBSFL_ATTACHEDONLY</dt> <dd>Only attached and installed devices are enumerated. </dd> <dt>DIEDBSFL_AVAILABLEDEVICES</dt> <dd>Only unowned, installed devices are enumerated. </dd> <dt>DIEDBSFL_FORCEFEEDBACK</dt> <dd>Only devices that support force feedback are enumerated. </dd> <dt>DIEDBSFL_MULTIMICEKEYBOARDS</dt> <dd>Only secondary (non-system) keyboard and mouse devices. </dd> <dt>DIEDBSFL_NONGAMINGDEVICES</dt> <dd>Only HID-compliant devices whose primary purpose is not as a gaming device. Devices such as USB speakers and multimedia buttons on some keyboards would fall within this value. </dd> <dt>DIEDBSFL_THISUSER</dt> <dd>All installed devices for the user identified by ptszUserName, and all unowned devices, are enumerated. </dd> <dt>DIEDBSFL_VALID</dt> <dd>DIEDBSFL_VALID is also defined in Dinput.h, but is not used by applications. </dd> </dl> </dd></param>
/// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.DirectInput.ResultCode.Ok"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.NotInitialized"/>.</p></returns>
/// <remarks>
/// <p>The keyboard and mouse are enumerated last.</p> <table><tr><th>Note </th></tr><tr><td>The order in which devices are enumerated by DirectInput is not guaranteed.</td></tr></table>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInput8W::EnumDevicesBySemantics']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectinput8.idirectinput8.enumdevicesbysemantics</msdn-id>
/// <unmanaged>HRESULT IDirectInput8W::EnumDevicesBySemantics([In] const wchar_t* arg0,[In] DIACTIONFORMATW* arg1,[In] __function__stdcall* arg2,[In] void* arg3,[In] unsigned int arg4)</unmanaged>
/// <unmanaged-short>IDirectInput8W::EnumDevicesBySemantics</unmanaged-short>
internal void EnumDevicesBySemantics(string arg0, ref SharpDX.DirectInput.ActionFormat arg1, SharpDX.FunctionCallback arg2, System.IntPtr arg3, int arg4) {
unsafe {
IntPtr arg0_ = Utilities.StringToHGlobalUni(arg0);
var arg1_ = new SharpDX.DirectInput.ActionFormat.__Native();
arg1.__MarshalTo(ref arg1_);
SharpDX.Result __result__;
__result__=
SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, (void*)arg0_, &arg1_, arg2, (void*)arg3, arg4,((void**)(*(void**)_nativePointer))[9]);
Marshal.FreeHGlobal(arg0_ );
arg1.__MarshalFree(ref arg1_);
__result__.CheckError();
}
}
示例13: CreateSoundBuffer
/// <summary>
/// The CreateSoundBuffer method creates a sound buffer object to manage audio samples.
/// </summary>
/// <param name="cDSBufferDescRef"><dd> Address of a <see cref="SharpDX.DirectSound.SoundBufferDescription"/> structure that describes the sound buffer to create. </dd></param>
/// <param name="dSBufferOut"><dd> Address of a variable that receives the <see cref="SharpDX.DirectSound.SoundBuffer"/> interface of the new buffer object. Use QueryInterface to obtain <see cref="SharpDX.DirectSound.SecondarySoundBuffer"/>. <see cref="SharpDX.DirectSound.SecondarySoundBuffer"/> is not available for the primary buffer. </dd></param>
/// <param name="unkOuterRef"><dd> Address of the controlling object's <see cref="SharpDX.ComObject"/> interface for COM aggregation. Must be <c>null</c>. </dd></param>
/// <returns><p>If the method succeeds, the return value is DS_OK, or DS_NO_VIRTUALIZATION if a requested 3D algorithm was not available and stereo panning was substituted. See the description of the guid3DAlgorithm member of <see cref="SharpDX.DirectSound.SoundBufferDescription"/>. If the method fails, the return value may be one of the error values shown in the following table.</p> <table> <tr><td>Return code</td></tr> <tr><td>DSERR_ALLOCATED </td></tr> <tr><td>DSERR_BADFORMAT </td></tr> <tr><td>DSERR_BUFFERTOOSMALL </td></tr> <tr><td>DSERR_CONTROLUNAVAIL </td></tr> <tr><td>DSERR_DS8_REQUIRED </td></tr> <tr><td>DSERR_INVALIDCALL </td></tr> <tr><td>DSERR_INVALIDPARAM </td></tr> <tr><td>DSERR_NOAGGREGATION </td></tr> <tr><td>DSERR_OUTOFMEMORY </td></tr> <tr><td>DSERR_UNINITIALIZED </td></tr> <tr><td>DSERR_UNSUPPORTED </td></tr> </table></returns>
/// <remarks>
/// <p>DirectSound does not initialize the contents of the buffer, and the application cannot assume that it contains silence.</p> <p>If an attempt is made to create a buffer with the <see cref="SharpDX.DirectSound.BufferFlags.Hardware"/> flag on a system where hardware acceleration is not available, the method fails with either DSERR_CONTROLUNAVAIL or DSERR_INVALIDCALL, depending on the operating system.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectSound::CreateSoundBuffer']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectsound8.idirectsound8.createsoundbuffer</msdn-id>
/// <unmanaged>HRESULT IDirectSound::CreateSoundBuffer([In] const DSBUFFERDESC* pcDSBufferDesc,[Out] void** ppDSBuffer,[In] IUnknown* pUnkOuter)</unmanaged>
/// <unmanaged-short>IDirectSound::CreateSoundBuffer</unmanaged-short>
internal void CreateSoundBuffer(SharpDX.DirectSound.SoundBufferDescription cDSBufferDescRef, out System.IntPtr dSBufferOut, SharpDX.ComObject unkOuterRef) {
unsafe {
var cDSBufferDescRef_ = SharpDX.DirectSound.SoundBufferDescription.__NewNative();
cDSBufferDescRef.__MarshalTo(ref cDSBufferDescRef_);
SharpDX.Result __result__;
fixed (void* dSBufferOut_ = &dSBufferOut)
__result__=
SharpDX.DirectSound.LocalInterop.Calliint(_nativePointer, &cDSBufferDescRef_, dSBufferOut_, (void*)((unkOuterRef == null)?IntPtr.Zero:unkOuterRef.NativePointer),((void**)(*(void**)_nativePointer))[3]);
cDSBufferDescRef.__MarshalFree(ref cDSBufferDescRef_);
__result__.CheckError();
}
}
示例14: SetAllParameters
/// <summary>
/// The SetAllParameters method sets all 3D parameters of the sound environment and the listener.
/// </summary>
/// <param name="cListenerRef"><dd> Address of a <see cref="SharpDX.DirectSound.Listener3DSettings"/> structure that contains information describing all 3D listener parameters. </dd></param>
/// <param name="apply"><dd> Value that specifies when the setting should be applied. This value must be one of the following: <table> <tr><td>Value</td><td>Description</td></tr> <tr><td>DS3D_DEFERRED</td><td>Settings are not applied until the application calls the CommitDeferredSettings method. This allows the application to change several settings and generate a single recalculation.</td></tr> <tr><td>DS3D_IMMEDIATE</td><td>Settings are applied immediately, causing the system to recalculate the 3D coordinates for all 3D sound buffers.</td></tr> </table> </dd></param>
/// <returns><p>If the method succeeds, the return value is DS_OK. If the method fails, the return value may be DSERR_INVALIDPARAM.</p></returns>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectSound3DListener::SetAllParameters']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectsound3dlistener8.idirectsound3dlistener8.setallparameters</msdn-id>
/// <unmanaged>HRESULT IDirectSound3DListener::SetAllParameters([In] const DS3DLISTENER* pcListener,[In] unsigned int dwApply)</unmanaged>
/// <unmanaged-short>IDirectSound3DListener::SetAllParameters</unmanaged-short>
internal void SetAllParameters(SharpDX.DirectSound.Listener3DSettings cListenerRef, int apply) {
unsafe {
var cListenerRef_ = SharpDX.DirectSound.Listener3DSettings.__NewNative();
cListenerRef.__MarshalTo(ref cListenerRef_);
SharpDX.Result __result__;
__result__=
SharpDX.DirectSound.LocalInterop.Calliint(_nativePointer, &cListenerRef_, apply,((void**)(*(void**)_nativePointer))[10]);
cListenerRef.__MarshalFree(ref cListenerRef_);
__result__.CheckError();
}
}
示例15: Initialize
/// <summary>
/// The Initialize method initializes a sound buffer object if it has not yet been initialized.
/// </summary>
/// <param name="directSoundRef"><dd> Address of the device object associated with this buffer. </dd></param>
/// <param name="cDSBufferDescRef"><dd> Address of a <see cref="SharpDX.DirectSound.SoundBufferDescription"/> structure that contains the values used to initialize this sound buffer. </dd></param>
/// <returns><p>If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the following error values.</p> <table> <tr><td>Return code</td></tr> <tr><td>DSERR_INVALIDPARAM </td></tr> <tr><td>DSERR_ALREADYINITIALIZED </td></tr> </table></returns>
/// <remarks>
/// <p>Because the CreateSoundBuffer method calls Initialize internally, applications do not need to call this method.</p>
/// </remarks>
/// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectSoundBuffer::Initialize']/*"/>
/// <msdn-id>microsoft.directx_sdk.idirectsoundbuffer8.idirectsoundbuffer8.initialize</msdn-id>
/// <unmanaged>HRESULT IDirectSoundBuffer::Initialize([In] IDirectSound* pDirectSound,[In] const DSBUFFERDESC* pcDSBufferDesc)</unmanaged>
/// <unmanaged-short>IDirectSoundBuffer::Initialize</unmanaged-short>
public void Initialize(SharpDX.DirectSound.DirectSoundBase directSoundRef, SharpDX.DirectSound.SoundBufferDescription cDSBufferDescRef) {
unsafe {
var cDSBufferDescRef_ = SharpDX.DirectSound.SoundBufferDescription.__NewNative();
cDSBufferDescRef.__MarshalTo(ref cDSBufferDescRef_);
SharpDX.Result __result__;
__result__=
SharpDX.DirectSound.LocalInterop.Calliint(_nativePointer, (void*)((directSoundRef == null)?IntPtr.Zero:directSoundRef.NativePointer), &cDSBufferDescRef_,((void**)(*(void**)_nativePointer))[10]);
cDSBufferDescRef.__MarshalFree(ref cDSBufferDescRef_);
__result__.CheckError();
}
}