public void SetupObjectMaterial(SharpDX.Color color) { // Set up a material. The material here just has the diffuse and ambient // colors set to yellow. Note that only one material can be used at a time. SharpDX.Direct3D9.Material mtrl = new SharpDX.Direct3D9.Material(); mtrl.Diffuse = color; mtrl.Ambient = color; m_pd3dDevice.Material = mtrl; }
// Method to marshal from native to managed struct internal unsafe void __MarshalFrom(ref __Native @ref) { this.MaterialD3D = @ref.MaterialD3D; this.TextureFileName = ( @ref.TextureFileName == IntPtr.Zero )?null:Marshal.PtrToStringAnsi(@ref.TextureFileName); }
/// <summary> /// <p>Retrieves the current material properties for the device.</p> /// </summary> /// <param name="materialRef"><dd> <p>Pointer to a <strong><see cref="SharpDX.Direct3D9.Material"/></strong> structure to fill with the currently set material properties. </p> </dd></param> /// <returns><p>If the method succeeds, the return value is <see cref="SharpDX.Direct3D9.ResultCode.Success"/>. <see cref="SharpDX.Direct3D9.ResultCode.InvalidCall"/> if the pMaterial parameter is invalid. </p></returns> /// <remarks> /// <p>This method will not return device state for a device that is created using <see cref="SharpDX.Direct3D9.CreateFlags.PureDevice"/>. If you want to use this method, you must create your device with any of the other values in <see cref="SharpDX.Direct3D9.CreateFlags"/>. </p> /// </remarks> /// <include file='.\..\Documentation\CodeComments.xml' path="/comments/comment[@id='IDirect3DDevice9::GetMaterial']/*"/> /// <msdn-id>bb174394</msdn-id> /// <unmanaged>HRESULT IDirect3DDevice9::GetMaterial([Out] D3DMATERIAL9* pMaterial)</unmanaged> /// <unmanaged-short>IDirect3DDevice9::GetMaterial</unmanaged-short> internal void GetMaterial(out SharpDX.Direct3D9.Material materialRef) { unsafe { materialRef = new SharpDX.Direct3D9.Material(); SharpDX.Result __result__; fixed (void* materialRef_ = &materialRef) __result__= SharpDX.Direct3D9.LocalInterop.Calliint(_nativePointer, materialRef_,((void**)(*(void**)_nativePointer))[50]); __result__.CheckError(); } }