예제 #1
0
        /// <summary>	
        /// <p>Creates a font object indirectly for both a device and a font.</p>	
        /// </summary>	
        /// <param name="deviceRef"><dd>  <p>Pointer to an <strong><see cref="SharpDX.Direct3D9.Device"/></strong> interface, the device to be associated with the font object.</p> </dd></param>	
        /// <param name="descRef"><dd>  <p>Pointer to a <strong><see cref="SharpDX.Direct3D9.FontDescription"/></strong> structure, describing the attributes of the font object to create. If the compiler settings require Unicode, the data type <see cref="SharpDX.Direct3D9.FontDescription"/> resolves to <see cref="SharpDX.Direct3D9.FontDescription"/>; otherwise, the data type resolves to D3DXFONT_DESCA. See Remarks.</p> </dd></param>	
        /// <param name="fontOut"><dd>  <p>Returns a reference to an <strong><see cref="SharpDX.Direct3D9.Font"/></strong> interface, representing the created font 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: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>, E_OUTOFMEMORY.</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.CreateFontIndirect"/>. Otherwise, the function call resolves to D3DXCreateFontIndirectA because ANSI strings are being used.</p>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='D3DXCreateFontIndirectW']/*"/>	
        /// <msdn-id>bb172774</msdn-id>	
        /// <unmanaged>HRESULT D3DXCreateFontIndirectW([In] IDirect3DDevice9* pDevice,[In] const D3DXFONT_DESCW* pDesc,[Out, Fast] ID3DXFont** ppFont)</unmanaged>	
        /// <unmanaged-short>D3DXCreateFontIndirectW</unmanaged-short>	
        public static void CreateFontIndirect(SharpDX.Direct3D9.Device deviceRef, ref SharpDX.Direct3D9.FontDescription descRef, SharpDX.Direct3D9.Font fontOut) {
            unsafe {
                var descRef_ = new SharpDX.Direct3D9.FontDescription.__Native();
                descRef.__MarshalTo(ref descRef_);
                IntPtr fontOut_ = IntPtr.Zero;
                SharpDX.Result __result__;
                __result__= 
				D3DXCreateFontIndirectW_((void*)((deviceRef == null)?IntPtr.Zero:deviceRef.NativePointer), &descRef_, &fontOut_);		
                descRef.__MarshalFree(ref descRef_);
                ((SharpDX.Direct3D9.Font)fontOut).NativePointer = fontOut_;
                __result__.CheckError();
            }
        }
예제 #2
0
        /// <summary>	
        /// <p>Gets a description of the current font object. GetDescW and GetDescA are identical to this method, except that a reference is returned to a <strong><see cref="SharpDX.Direct3D9.FontDescription"/></strong> or <strong>D3DXFONT_DESCA</strong> structure, respectively.</p>	
        /// </summary>	
        /// <param name="descRef">No documentation.</param>	
        /// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.Result.Ok"/>. If the method fails, the following value will be returned: <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/>.</p></returns>	
        /// <remarks>	
        /// <p>This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the <strong>D3DXFONT_DESCA</strong> structure.</p>	
        /// </remarks>	
        /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='ID3DXFont::GetDescW']/*"/>	
        /// <msdn-id>bb173964</msdn-id>	
        /// <unmanaged>HRESULT ID3DXFont::GetDescW([Out] D3DXFONT_DESCW* pDesc)</unmanaged>	
        /// <unmanaged-short>ID3DXFont::GetDescW</unmanaged-short>	
        internal void GetDescription(out SharpDX.Direct3D9.FontDescription descRef) {
            unsafe {
                var descRef_ = new SharpDX.Direct3D9.FontDescription.__Native();
                SharpDX.Result __result__;
                __result__= 
				SharpDX.Direct3D9.LocalInterop.Calliint(_nativePointer, &descRef_,((void**)(*(void**)_nativePointer))[5]);		
                descRef = new SharpDX.Direct3D9.FontDescription();
                descRef.__MarshalFrom(ref descRef_);
                __result__.CheckError();
            }
        }