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§

source

fn CreateSoftwareAdapter(&self, hmodule: &HINSTANCE) -> HrResult<IDXGIAdapter>

source

fn CreateSwapChain( &self, device: &impl ole_IUnknown, desc: &DXGI_SWAP_CHAIN_DESC ) -> HrResult<IDXGISwapChain>

source

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<_>>>()?;
source

fn GetWindowAssociation(&self) -> HrResult<HWND>

source

fn MakeWindowAssociation(&self, hwnd: &HWND, flags: DXGI_MWA) -> HrResult<()>

Object Safety§

This trait is not object safe.

Implementors§