当前位置: 首页>>代码示例>>C#>>正文


C# SharpDX.__MarshalTo方法代码示例

本文整理汇总了C#中SharpDX.__MarshalTo方法的典型用法代码示例。如果您正苦于以下问题:C# SharpDX.__MarshalTo方法的具体用法?C# SharpDX.__MarshalTo怎么用?C# SharpDX.__MarshalTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharpDX的用法示例。


在下文中一共展示了SharpDX.__MarshalTo方法的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_);
     }
 }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:27,代码来源:X3DAudio29.cs

示例2: CreateResourceTexture

        private unsafe static void CreateResourceTexture(EffectContext context, System.Guid resourceId, SharpDX.Direct2D1.ResourceTextureProperties resourceTextureProperties, byte[] data, int[] strides, ResourceTexture outTexture) 
        {
            var resourceTexturePropertiesNative = new ResourceTextureProperties.__Native();
            resourceTextureProperties.__MarshalTo(ref resourceTexturePropertiesNative);

            if (resourceTextureProperties.Extents == null || resourceTextureProperties.Extents.Length != resourceTextureProperties.Dimensions)
                throw new ArgumentException("Extents array must be same size than dimensions", "resourceTextureProperties");

            if (resourceTextureProperties.ExtendModes == null || resourceTextureProperties.ExtendModes.Length != resourceTextureProperties.Dimensions)
                throw new ArgumentException("ExtendModes array must be same size than dimensions", "resourceTextureProperties");

            fixed (void* pExtents = resourceTextureProperties.Extents) {
                fixed (void* pExtendModes = resourceTextureProperties.ExtendModes) {
                    resourceTexturePropertiesNative.ExtentsPointer = (IntPtr)pExtents;
                    resourceTexturePropertiesNative.ExtendModesPointer = (IntPtr)pExtendModes;
                    context.CreateResourceTexture(resourceId, new IntPtr(&resourceTexturePropertiesNative), data, strides, data == null ? 0 : data.Length, outTexture);
                }
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:19,代码来源:ResourceTexture.cs

示例3: 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();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:29,代码来源:Interfaces.cs

示例4: 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();
             }
         }
开发者ID:JoeErickson,项目名称:SharpDX,代码行数:24,代码来源:Functions.cs

示例5: CreateGraphicsPipelineState

        /// <summary>	
        /// No documentation for Direct3D12	
        /// </summary>	
        /// <param name="descRef">No documentation.</param>	
        /// <param name="riid">No documentation.</param>	
        /// <returns>No documentation.</returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3D12Device::CreateGraphicsPipelineState']/*"/>	
        /// <unmanaged>HRESULT ID3D12Device::CreateGraphicsPipelineState([In] const void* pDesc,[In] const GUID&amp; riid,[Out] ID3D12PipelineState** ppPipelineState)</unmanaged>	
        /// <unmanaged-short>ID3D12Device::CreateGraphicsPipelineState</unmanaged-short>	
        public unsafe SharpDX.Direct3D12.PipelineState CreateGraphicsPipelineState(SharpDX.Direct3D12.GraphicsPipelineStateDescription desc)
        {
            // Use a custom marshalling routine for this class
            var nativeDesc = new GraphicsPipelineStateDescription.__Native();
            desc.__MarshalTo(ref nativeDesc);

            // Pin buffers if necessary
            fixed (void* pVertexShader = desc.VertexShader.Buffer)
            fixed (void* pGeometryShader = desc.GeometryShader.Buffer)
            fixed (void* pDomainShader = desc.DomainShader.Buffer)
            fixed (void* pHullShader = desc.HullShader.Buffer)
            fixed (void* pPixelShader = desc.PixelShader.Buffer)
            {
                // Transfer pin buffer address to marshal
                desc.VertexShader.UpdateNative(ref nativeDesc.VertexShader, (IntPtr)pVertexShader);
                desc.GeometryShader.UpdateNative(ref nativeDesc.GeometryShader, (IntPtr)pGeometryShader);
                desc.DomainShader.UpdateNative(ref nativeDesc.DomainShader, (IntPtr)pDomainShader);
                desc.HullShader.UpdateNative(ref nativeDesc.HullShader, (IntPtr)pHullShader);
                desc.PixelShader.UpdateNative(ref nativeDesc.PixelShader, (IntPtr)pPixelShader);

                // Marshal input elements
                var elements = desc.InputLayout.Elements;
                var nativeElements = (InputElement.__Native*)0;
                if (elements != null && elements.Length > 0)
                {
                    var ptr = stackalloc InputElement.__Native[elements.Length];
                    nativeElements = ptr;
                    for (int i = 0; i < elements.Length; i++)
                    {
                        elements[i].__MarshalTo(ref nativeElements[i]);
                    }

                    nativeDesc.InputLayout.InputElementsPointer = new IntPtr(nativeElements);
                    nativeDesc.InputLayout.ElementCount = elements.Length;
                }

                //Marshal stream output elements
                var streamOutElements = desc.StreamOutput.Elements;
                var nativeStreamOutElements = (StreamOutputElement.__Native*)0;
                if (streamOutElements != null && streamOutElements.Length > 0)
                {
                    var ptr = stackalloc StreamOutputElement.__Native[streamOutElements.Length];
                    nativeStreamOutElements = ptr;
                    for (int i = 0; i < streamOutElements.Length; i++)
                    {
                        streamOutElements[i].__MarshalTo(ref nativeStreamOutElements[i]);
                    }

                    nativeDesc.StreamOutput.StreamOutputEntriesPointer = new IntPtr(nativeStreamOutElements);
                    nativeDesc.StreamOutput.EntrieCount = streamOutElements.Length;
                }

                try
                {
                    // Create the pipeline state
                    return CreateGraphicsPipelineState(new IntPtr(&nativeDesc), Utilities.GetGuidFromType(typeof(PipelineState)));
                }
                finally
                {
                    if (elements != null)
                    {
                        for (int i = 0; i < elements.Length; i++)
                        {
                            nativeElements[i].__MarshalFree();
                        }
                    }

                    if (streamOutElements != null)
                    {
                        for (int i = 0; i < streamOutElements.Length; i++)
                        {
                            nativeStreamOutElements[i].__MarshalFree();
                        }
                    }
                }
            }
        }
开发者ID:TomAtWork,项目名称:SharpDX,代码行数:86,代码来源:Device.cs

示例6: CreateCommandSignature

        /// <summary>	
        /// No documentation for Direct3D12	
        /// </summary>	
        /// <param name="descRef">No documentation.</param>	
        /// <param name="rootSignatureRef">No documentation.</param>	
        /// <param name="riid">No documentation.</param>	
        /// <returns>No documentation.</returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3D12Device::CreateCommandSignature']/*"/>	
        /// <unmanaged>HRESULT ID3D12Device::CreateCommandSignature([In] const D3D12_COMMAND_SIGNATURE* pDesc,[In, Optional] ID3D12RootSignature* pRootSignature,[In] const GUID&amp; riid,[Out] ID3D12CommandSignature** ppvCommandSignature)</unmanaged>	
        /// <unmanaged-short>ID3D12Device::CreateCommandSignature</unmanaged-short>	
        public unsafe CommandSignature CreateCommandSignature(SharpDX.Direct3D12.CommandSignatureDescription descRef, SharpDX.Direct3D12.RootSignature rootSignatureRef)
        {
            var nativeDesc = new CommandSignatureDescription.__Native();
            descRef.__MarshalTo(ref nativeDesc);
            fixed(void* pIndirectArguments = descRef.IndirectArguments)
            {
                if(descRef.IndirectArguments != null)
                {
                    nativeDesc.ArgumentDescCount = descRef.IndirectArguments.Length;
                    nativeDesc.ArgumentDescsPointer = new IntPtr(pIndirectArguments);
                }

                return CreateCommandSignature(new IntPtr(&nativeDesc), rootSignatureRef, Utilities.GetGuidFromType(typeof(CommandSignature)));
            }
        }
开发者ID:TomAtWork,项目名称:SharpDX,代码行数:25,代码来源:Device.cs

示例7: 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__;
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:20,代码来源:Functions.cs

示例8: 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__;
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:23,代码来源:Functions.cs

示例9: 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();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:29,代码来源:Functions.cs

示例10: FullDuplexCreate

        /// <summary>	
        /// <p>The <strong>DirectSoundFullDuplexCreate</strong> function is documented under a different name. For complete documentation of this function, see DirectSoundFullDuplexCreate8. </p>	
        /// </summary>	
        /// <param name="cGuidCaptureDeviceRef">No documentation.</param>	
        /// <param name="cGuidRenderDeviceRef">No documentation.</param>	
        /// <param name="cDSCBufferDescRef">No documentation.</param>	
        /// <param name="cDSBufferDescRef">No documentation.</param>	
        /// <param name="hWnd">No documentation.</param>	
        /// <param name="dwLevel">No documentation.</param>	
        /// <param name="dSFDOut">No documentation.</param>	
        /// <param name="dSCBuffer8Out">No documentation.</param>	
        /// <param name="dSBuffer8Out">No documentation.</param>	
        /// <param name="unkOuterRef">No documentation.</param>	
        /// <returns><p>If this function succeeds, it returns <strong><see cref="SharpDX.Result.Ok"/></strong>. Otherwise, it returns an <strong><see cref="SharpDX.Result"/></strong> error code.</p></returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='DirectSoundFullDuplexCreate']/*"/>	
        /// <msdn-id>bb432248</msdn-id>	
        /// <unmanaged>HRESULT DirectSoundFullDuplexCreate([In, Optional] const GUID* pcGuidCaptureDevice,[In, Optional] const GUID* pcGuidRenderDevice,[In] const DSCBUFFERDESC* pcDSCBufferDesc,[In] const DSBUFFERDESC* pcDSBufferDesc,[In] HWND hWnd,[In] unsigned int dwLevel,[Out, Fast] IDirectSoundFullDuplex** ppDSFD,[Out] IDirectSoundCaptureBuffer8** ppDSCBuffer8,[Out] IDirectSoundBuffer8** ppDSBuffer8,[In] IUnknown* pUnkOuter)</unmanaged>	
        /// <unmanaged-short>DirectSoundFullDuplexCreate</unmanaged-short>	
        public static void FullDuplexCreate(System.Guid? cGuidCaptureDeviceRef, System.Guid? cGuidRenderDeviceRef, SharpDX.DirectSound.CaptureBufferDescription cDSCBufferDescRef, SharpDX.DirectSound.SoundBufferDescription cDSBufferDescRef, System.IntPtr hWnd, int dwLevel, SharpDX.DirectSound.FullDuplex dSFDOut, out SharpDX.DirectSound.CaptureBuffer dSCBuffer8Out, out SharpDX.DirectSound.SecondarySoundBuffer dSBuffer8Out, SharpDX.ComObject unkOuterRef) {
            unsafe {
                System.Guid cGuidCaptureDeviceRef_;
                if (cGuidCaptureDeviceRef.HasValue)
                    cGuidCaptureDeviceRef_ = cGuidCaptureDeviceRef.Value;				
                System.Guid cGuidRenderDeviceRef_;
                if (cGuidRenderDeviceRef.HasValue)
                    cGuidRenderDeviceRef_ = cGuidRenderDeviceRef.Value;				
                var cDSCBufferDescRef_ = SharpDX.DirectSound.CaptureBufferDescription.__NewNative();
                cDSCBufferDescRef.__MarshalTo(ref cDSCBufferDescRef_);
                var cDSBufferDescRef_ = SharpDX.DirectSound.SoundBufferDescription.__NewNative();
                cDSBufferDescRef.__MarshalTo(ref cDSBufferDescRef_);
                IntPtr dSFDOut_ = IntPtr.Zero;
                IntPtr dSCBuffer8Out_ = IntPtr.Zero;
                IntPtr dSBuffer8Out_ = IntPtr.Zero;
                SharpDX.Result __result__;
                __result__= 
				DirectSoundFullDuplexCreate_((cGuidCaptureDeviceRef.HasValue)?&cGuidCaptureDeviceRef_:(void*)IntPtr.Zero, (cGuidRenderDeviceRef.HasValue)?&cGuidRenderDeviceRef_:(void*)IntPtr.Zero, &cDSCBufferDescRef_, &cDSBufferDescRef_, (void*)hWnd, dwLevel, &dSFDOut_, &dSCBuffer8Out_, &dSBuffer8Out_, (void*)((unkOuterRef == null)?IntPtr.Zero:unkOuterRef.NativePointer));		
                cDSCBufferDescRef.__MarshalFree(ref cDSCBufferDescRef_);
                cDSBufferDescRef.__MarshalFree(ref cDSBufferDescRef_);
                ((SharpDX.DirectSound.FullDuplex)dSFDOut).NativePointer = dSFDOut_;
                dSCBuffer8Out= (dSCBuffer8Out_ == IntPtr.Zero)?null:new SharpDX.DirectSound.CaptureBuffer(dSCBuffer8Out_);	
                dSBuffer8Out= (dSBuffer8Out_ == IntPtr.Zero)?null:new SharpDX.DirectSound.SecondarySoundBuffer(dSBuffer8Out_);	
                __result__.CheckError();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:44,代码来源:Functions.cs

示例11: GetImageInfo

        /// <summary>	
        /// Retrieves information about a device image for use in a configuration property sheet.	
        /// </summary>	
        /// <param name="arg0"><dd> Address of a <see cref="SharpDX.DirectInput.DeviceImageHeader"/> structure that receives information about the device image.  </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.MapFileFail"/>, <see cref="SharpDX.DirectInput.ResultCode.MoreData"/>, <see cref="SharpDX.DirectInput.ResultCode.NotInitialized"/>, <see cref="SharpDX.DirectInput.ResultCode.ObjectNotFound"/>.</p></returns>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputDevice8W::GetImageInfo']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.getimageinfo</msdn-id>	
        /// <unmanaged>HRESULT IDirectInputDevice8W::GetImageInfo([InOut] DIDEVICEIMAGEINFOHEADERW* arg0)</unmanaged>	
        /// <unmanaged-short>IDirectInputDevice8W::GetImageInfo</unmanaged-short>	
        internal void GetImageInfo(SharpDX.DirectInput.DeviceImageHeader arg0) {
            unsafe {
                var arg0_ = SharpDX.DirectInput.DeviceImageHeader.__NewNative();
                arg0.__MarshalTo(ref arg0_);
                SharpDX.Result __result__;
                __result__= 
				SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0_,((void**)(*(void**)_nativePointer))[31]);		
                arg0.__MarshalFrom(ref arg0_);
                arg0.__MarshalFree(ref arg0_);
                __result__.CheckError();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:21,代码来源:Interfaces.cs

示例12: SetActionMap

        /// <summary>	
        /// Sets the data format for a device and maps application-defined actions to device objects. It also sets the buffer size for buffered data.	
        /// </summary>	
        /// <param name="arg0"><dd> Address of a <see cref="SharpDX.DirectInput.ActionFormat"/> structure containing information about the action map to be applied.  </dd></param>	
        /// <param name="arg1"><dd> Unicode string that specifies the name of the user for which the action map is being set. A value of <c>null</c> specifies the user currently logged into the system.  </dd></param>	
        /// <param name="arg2"><dd> DWORD value that specifies how the action map is applied. This can be one of the following values.  <dl> <dt>DIDSAM_DEFAULT</dt> <dd> Set the action map for this user. If the map differs from the current map, the new settings are saved to disk. </dd> <dt>DIDSAM_FORCESAVE</dt> <dd> Always save the configuration to disk. </dd> <dt>DIDSAM_NOUSER</dt> <dd> Reset user ownership for this device in the default configuration property sheet. Resetting user ownership does not remove the current action map. </dd> </dl> </dd></param>	
        /// <returns><p>If the method succeeds, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.Ok"/>, <see cref="SharpDX.DirectInput.ResultCode.SettingsNotSaved"/>, or <see cref="SharpDX.DirectInput.ResultCode.WriteProtect"/>. If the method fails, the return value can be one of the following error values: <see cref="SharpDX.DirectInput.ResultCode.Acquired"/> or <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>, <see cref="SharpDX.DirectInput.ResultCode.SettingsNotSaved"/>, <see cref="SharpDX.DirectInput.ResultCode.WriteProtect"/>, <see cref="SharpDX.DirectInput.ResultCode.Acquired"/>, <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>.</p></returns>	
        /// <remarks>	
        /// <p>This method provides the mechanism to change action-to-control mapping from the device defaults. An application must use this method to map its in-game actions to virtual controls.</p> <p>The user name passed to this method binds a set of action mappings for a device to a specific user. Settings are automatically saved to disk when they differ from the currently applied map. Applications that accept input from multiple users should be very careful when applying action maps to the system mouse or keyboard, as the action maps for each user may conflict.</p> <p>The method can be called only when the device is not acquired.</p> <p>If <see cref="SharpDX.DirectInput.Device.BuildActionMap"/> succeeds but no actions have been mapped, a subsequent call to <see cref="SharpDX.DirectInput.Device.SetActionMap"/> will return <see cref="SharpDX.DirectInput.ResultCode.Ok"/> but a call to <see cref="SharpDX.DirectInput.Device"/> Interface will fail with <see cref="SharpDX.DirectInput.ResultCode.InvalidParam"/>.</p>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirectInputDevice8W::SetActionMap']/*"/>	
        /// <msdn-id>microsoft.directx_sdk.idirectinputdevice8.idirectinputdevice8.setactionmap</msdn-id>	
        /// <unmanaged>HRESULT IDirectInputDevice8W::SetActionMap([In] DIACTIONFORMATW* arg0,[In] const wchar_t* arg1,[In] unsigned int arg2)</unmanaged>	
        /// <unmanaged-short>IDirectInputDevice8W::SetActionMap</unmanaged-short>	
        internal void SetActionMap(ref SharpDX.DirectInput.ActionFormat arg0, string arg1, int arg2) {
            unsafe {
                var arg0_ = new SharpDX.DirectInput.ActionFormat.__Native();
                arg0.__MarshalTo(ref arg0_);
                IntPtr arg1_ = Utilities.StringToHGlobalUni(arg1);
                SharpDX.Result __result__;
                __result__= 
				SharpDX.DirectInput.LocalInterop.Calliint(_nativePointer, &arg0_, (void*)arg1_, arg2,((void**)(*(void**)_nativePointer))[30]);		
                arg0.__MarshalFree(ref arg0_);
                Marshal.FreeHGlobal(arg1_ );
                __result__.CheckError();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:27,代码来源:Interfaces.cs

示例13: 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&amp; 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();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:28,代码来源:Interfaces.cs

示例14: 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();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:23,代码来源:Interfaces.cs

示例15: 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();
            }
        }
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:20,代码来源:Interfaces.cs


注:本文中的SharpDX.__MarshalTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。