Trait winsafe::prelude::dxgi_IDXGIFactory
source · pub trait dxgi_IDXGIFactory: dxgi_IDXGIObject {
// Provided methods
fn CreateSoftwareAdapter(
&self,
hmodule: &HINSTANCE
) -> HrResult<IDXGIAdapter> { ... }
fn CreateSwapChain(
&self,
device: &impl ole_IUnknown,
desc: &DXGI_SWAP_CHAIN_DESC
) -> HrResult<IDXGISwapChain> { ... }
fn EnumAdapters(&self) -> impl Iterator<Item = HrResult<IDXGIAdapter>> + '_ { ... }
fn GetWindowAssociation(&self) -> HrResult<HWND> { ... }
fn MakeWindowAssociation(
&self,
hwnd: &HWND,
flags: DXGI_MWA
) -> HrResult<()> { ... }
}
Available on crate features
kernel
and dxgi
only.Expand description
This trait is enabled with the dxgi
feature, and provides methods for
IDXGIFactory
.
Prefer importing this trait through the prelude:
use winsafe::prelude::*;
Provided Methods§
sourcefn CreateSoftwareAdapter(&self, hmodule: &HINSTANCE) -> HrResult<IDXGIAdapter>
fn CreateSoftwareAdapter(&self, hmodule: &HINSTANCE) -> HrResult<IDXGIAdapter>
sourcefn CreateSwapChain(
&self,
device: &impl ole_IUnknown,
desc: &DXGI_SWAP_CHAIN_DESC
) -> HrResult<IDXGISwapChain>
fn CreateSwapChain( &self, device: &impl ole_IUnknown, desc: &DXGI_SWAP_CHAIN_DESC ) -> HrResult<IDXGISwapChain>
IDXGIFactory::CreateSwapChain
method.
sourcefn EnumAdapters(&self) -> impl Iterator<Item = HrResult<IDXGIAdapter>> + '_
fn EnumAdapters(&self) -> impl Iterator<Item = HrResult<IDXGIAdapter>> + '_
IDXGIFactory::EnumAdapters
method.
Returns an iterator over IDXGIAdapter
elements.
§Examples
use winsafe::{self as w, prelude::*};
let factory: w::IDXGIFactory; // initialized somewhere
for adapter in factory.EnumAdapters() {
let adapter = adapter?;
// ...
}
// Collecting into a Vec
let adapters: Vec<w::IDXGIAdapter> =
factory.EnumAdapters()
.collect::<w::HrResult<Vec<_>>>()?;
sourcefn GetWindowAssociation(&self) -> HrResult<HWND>
fn GetWindowAssociation(&self) -> HrResult<HWND>
Object Safety§
This trait is not object safe.