Trait thindx::d3d9::IDirect3DSwapChain9Ext
source · [−]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
thindx | docs.microsoft.com | description |
---|---|---|
get_back_buffer | GetBackBuffer | Retrieves a back buffer from the swap chain of the device. |
get_device | GetDevice | Retrieves the device associated with the swap chain. |
get_display_mode | GetDisplayMode | Retrieves the current resolution / refresh rate. |
get_front_buffer_data | GetFrontBufferData | Retrieves a copy of the swapchain’s front buffer |
get_present_parameters | GetPresentParameters | Retrieves the presentation parameters associated with a swap chain. |
get_raster_status | GetRasterStatus | Returns vblank/scanline status for the swap chain’s presentation monitor. |
present | Present | Presents the contents of the next back buffer. |
See Also
Associated Types
Provided methods
fn get_back_buffer(
&self,
i_back_buffer: impl TryInto<UINT>,
ty: impl Into<BackBufferType>
) -> Result<Self::Surface, MethodError>
fn get_back_buffer(
&self,
i_back_buffer: impl TryInto<UINT>,
ty: impl Into<BackBufferType>
) -> Result<Self::Surface, MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetBackBuffer
Retrieves a back buffer from the swap chain of the device.
fn get_device(&self) -> Result<Self::Device, MethodError>
fn get_device(&self) -> Result<Self::Device, MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetDevice
Retrieves the device associated with the swap chain.
fn get_display_mode(&self) -> Result<DisplayMode, MethodError>
fn get_display_mode(&self) -> Result<DisplayMode, MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetDisplayMode
Retrieves the display mode’s spatial resolution, color resolution, and refresh frequency.
unsafe fn get_front_buffer_data(
&self,
dest_surface: &impl IDirect3DSurface9Ext
) -> Result<(), MethodError>
unsafe fn get_front_buffer_data(
&self,
dest_surface: &impl IDirect3DSurface9Ext
) -> Result<(), MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetFrontBufferData
Retrieves a copy of the swapchain’s front buffer
⚠️ Safety ⚠️
fn get_present_parameters(&self) -> Result<D3DPRESENT_PARAMETERS, MethodError>
fn get_present_parameters(&self) -> Result<D3DPRESENT_PARAMETERS, MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetPresentParameters
Retrieves the presentation parameters associated with a swap chain.
fn get_raster_status(&self) -> Result<RasterStatus, MethodError>
fn get_raster_status(&self) -> Result<RasterStatus, MethodError>
[docs.microsoft.com] IDirect3DSwapChain9::GetRasterStatus
Returns information describing the raster of the monitor on which the swap chain is presented.
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>
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>
[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 originalpresentation_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 thehDeviceWindow
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
- D3DERR::DEVICEREMOVED When you least expect it
- D3DERR::DEVICELOST When switching into/out-of fullscreen, or when invoking
C:\Windows\System32\DXCap.exe -forcetdr
- D3DERR::INVALIDCALL If called within a IDirect3DDevice9Ext::begin_scene .. IDirect3DDevice9Ext::end_scene section, if the render target is the current render target.
- Ok(
()
)