pub trait IDirect3DSwapChain9Ext: AsSafe<IDirect3DSwapChain9> {
    type Device: From<Device>;
    type Surface: From<Surface>;
    fn get_back_buffer(
        &self,
        i_back_buffer: impl TryInto<UINT>,
        ty: impl Into<BackBufferType>
    ) -> Result<Self::Surface, MethodError> { ... }
fn get_device(&self) -> Result<Self::Device, MethodError> { ... }
fn get_display_mode(&self) -> Result<DisplayMode, MethodError> { ... }
unsafe fn get_front_buffer_data(
        &self,
        dest_surface: &impl IDirect3DSurface9Ext
    ) -> Result<(), MethodError> { ... }
fn get_present_parameters(
        &self
    ) -> Result<D3DPRESENT_PARAMETERS, MethodError> { ... }
fn get_raster_status(&self) -> Result<RasterStatus, MethodError> { ... }
fn present<'r>(
        &self,
        source_rect: impl IntoRectOrFull,
        dest_rect: impl IntoRectOrFull,
        dest_window_override: impl AsHWND,
        dirty_region: impl Into<Option<&'r RgnData>>,
        flags: impl Into<Present>
    ) -> Result<(), MethodError> { ... } }
Expand description

[docs.microsoft.com] IDirect3DSwapChain9 extension methods

Methods

thindxdocs.microsoft.comdescription
get_back_bufferGetBackBufferRetrieves a back buffer from the swap chain of the device.
get_deviceGetDeviceRetrieves the device associated with the swap chain.
get_display_modeGetDisplayModeRetrieves the current resolution / refresh rate.
get_front_buffer_dataGetFrontBufferDataRetrieves a copy of the swapchain’s front buffer
get_present_parametersGetPresentParametersRetrieves the presentation parameters associated with a swap chain.
get_raster_statusGetRasterStatusReturns vblank/scanline status for the swap chain’s presentation monitor.
presentPresentPresents the contents of the next back buffer.

See Also

Associated Types

Provided methods

[docs.microsoft.com] IDirect3DSwapChain9::GetBackBuffer

Retrieves a back buffer from the swap chain of the device.

[docs.microsoft.com] IDirect3DSwapChain9::GetDevice

Retrieves the device associated with the swap chain.

[docs.microsoft.com] IDirect3DSwapChain9::GetDisplayMode

Retrieves the display mode’s spatial resolution, color resolution, and refresh frequency.

[docs.microsoft.com] IDirect3DSwapChain9::GetFrontBufferData

Retrieves a copy of the swapchain’s front buffer

⚠️ Safety ⚠️
  • dest_surface may need to belong to the same Device as self
  • dest_surface may need to be the size of the entire desktop if the Device is in windowed mode

[docs.microsoft.com] IDirect3DSwapChain9::GetPresentParameters

Retrieves the presentation parameters associated with a swap chain.

[docs.microsoft.com] IDirect3DSwapChain9::GetRasterStatus

Returns information describing the raster of the monitor on which the swap chain is presented.

[docs.microsoft.com] IDirect3DSwapChain9::Present

Presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

⚠️ Safety ⚠️
  • It’s likely unsound to use an invalid, non-null hwnd
  • It’s likely unsound to use a null hwnd if the original presentation_parameters.hDeviceWindow is an invalid, non-null HWND
  • Out of bounds rects might also be an issue IDK?
Arguments
  • source_rect - “Must be ..” unless the SwapChain was created with SwapEffect::Copy. Can still be .. even then (the entire source surface is presented.)
  • dest_rect - “Must be ..” unless the SwapChain was created with SwapEffect::Copy. Can still be .. even then (the entire client area is filled.)
  • dest_window_override - The destination window to render to. If null / (), the runtime uses the hDeviceWindow member of D3DPRESENT_PARAMETERS for the presentation.
  • dirty_region - “Must be None” unless the SwapChain was created with SwapEffect::Copy. Can still be None even then (the entire region will be considered dirty.) The implementation is free to copy more than the exact dirty region.
  • flags - Valid values are Present::None, Present::DoNotWait, or Present::LinearContent.
Returns

Implementations on Foreign Types

Implementors