pub trait IDirect3D9ExExt: AsSafe<IDirect3D9Ex> {
// Provided methods
unsafe fn create_ex(sdk_version: SdkVersion) -> Result<Self, MethodError>
where Self: From<Rc<IDirect3D9Ex>> { ... }
unsafe fn create_device_ex(
&self,
adapter: u32,
device_type: impl Into<DevType>,
hwnd: HWND,
behavior_flags: impl Into<Create>,
presentation_parameters: &mut D3DPRESENT_PARAMETERS,
fullscreen_display_modes: &mut [D3DDISPLAYMODEEX],
) -> Result<DeviceEx, MethodError> { ... }
fn enum_adapter_modes_ex(
&self,
adapter: u32,
filter: impl Into<D3DDISPLAYMODEFILTER>,
mode: u32,
) -> Result<D3DDISPLAYMODEEX, MethodError> { ... }
fn get_adapter_display_mode_ex(
&self,
adapter: u32,
) -> Result<(D3DDISPLAYMODEEX, D3DDISPLAYROTATION), MethodError> { ... }
fn get_adapter_luid(&self, adapter: u32) -> Result<Luid, MethodError> { ... }
fn get_adapter_mode_count_ex(
&self,
adapter: u32,
filter: impl Into<D3DDISPLAYMODEFILTER>,
) -> u32 { ... }
}Expand description
[docs.microsoft.com] IDirect3D9Ex extension methods
§Methods
| thindx | docs.microsoft.com | Description |
|---|---|---|
| create | Direct3DCreate9Ex | Creates an IDirect3D9Ex object and returns an interface to it. |
| create_device_ex | CreateDeviceEx | Creates a device to represent the display adapter. |
| enum_adapter_modes_ex | EnumAdapterModesEx | Enumerate actual display mode info based on the given mode index. |
| get_adapter_display_mode_ex | GetAdapterDisplayModeEx | Retrieves the current display mode and rotation settings of the adapter. |
| get_adapter_luid | GetAdapterLUID | This method returns a Luid for the adapter that is specific to the adapter hardware. |
| get_adapter_mode_count_ex | GetAdapterModeCountEx | Returns the number of display modes available. |
Provided Methods§
Sourceunsafe fn create_ex(sdk_version: SdkVersion) -> Result<Self, MethodError>
unsafe fn create_ex(sdk_version: SdkVersion) -> Result<Self, MethodError>
[docs.microsoft.com] Direct3DCreate9Ex
Creates an IDirect3D9Ex object and returns an interface to it.
§⚠️ Safety ⚠️
While this individual call should be 100% safe/sound, there is a bunch of general soundness holes that Rust can’t always sanely guard against. These include:
- Unsound Direct3D API designs (e.g. shader creation functions that take a pointer and no length boundary!)
- Direct3D bugs (e.g. failing allocations may cause segfaults and worse)
- Kernel bugs (e.g. windows may BSOD)
- Driver bugs (e.g. gpus may hang/reset/???)
The unsafe of this fn is the token acknowledgement of those errors.
Sourceunsafe fn create_device_ex(
&self,
adapter: u32,
device_type: impl Into<DevType>,
hwnd: HWND,
behavior_flags: impl Into<Create>,
presentation_parameters: &mut D3DPRESENT_PARAMETERS,
fullscreen_display_modes: &mut [D3DDISPLAYMODEEX],
) -> Result<DeviceEx, MethodError>
unsafe fn create_device_ex( &self, adapter: u32, device_type: impl Into<DevType>, hwnd: HWND, behavior_flags: impl Into<Create>, presentation_parameters: &mut D3DPRESENT_PARAMETERS, fullscreen_display_modes: &mut [D3DDISPLAYMODEEX], ) -> Result<DeviceEx, MethodError>
[docs.microsoft.com] IDirect3D9Ex::CreateDeviceEx
Creates a device to represent the display adapter.
§⚠️ Safety ⚠️
- The caller’s codebase is responsible for ensuring any HWNDs (
hwnd,presentation_parameters.hDeviceWindow) outlive the Device. See IDirect3D9Ext::create_device for guidance and details. fullscreen_display_modesis assumed to contain an entry for every adapter ifbehavior_flags & D3DCREATE_ADAPTERGROUP_DEVICE(TODO: enforce this via checks?)
Sourcefn enum_adapter_modes_ex(
&self,
adapter: u32,
filter: impl Into<D3DDISPLAYMODEFILTER>,
mode: u32,
) -> Result<D3DDISPLAYMODEEX, MethodError>
fn enum_adapter_modes_ex( &self, adapter: u32, filter: impl Into<D3DDISPLAYMODEFILTER>, mode: u32, ) -> Result<D3DDISPLAYMODEEX, MethodError>
[docs.microsoft.com] IDirect3D9Ex::EnumAdapterModesEx
Enumerate actual display mode info based on the given mode index.
Sourcefn get_adapter_display_mode_ex(
&self,
adapter: u32,
) -> Result<(D3DDISPLAYMODEEX, D3DDISPLAYROTATION), MethodError>
fn get_adapter_display_mode_ex( &self, adapter: u32, ) -> Result<(D3DDISPLAYMODEEX, D3DDISPLAYROTATION), MethodError>
[docs.microsoft.com] IDirect3D9Ex::GetAdapterDisplayModeEx
Retrieves the current display mode and rotation settings of the adapter.
Sourcefn get_adapter_luid(&self, adapter: u32) -> Result<Luid, MethodError>
fn get_adapter_luid(&self, adapter: u32) -> Result<Luid, MethodError>
[docs.microsoft.com] IDirect3D9Ex::GetAdapterLUID
This method returns a unique identifier for the adapter that is specific to the adapter hardware. Applications can use this identifier to define robust mappings across various APIs (Direct3D 9, DXGI).
Sourcefn get_adapter_mode_count_ex(
&self,
adapter: u32,
filter: impl Into<D3DDISPLAYMODEFILTER>,
) -> u32
fn get_adapter_mode_count_ex( &self, adapter: u32, filter: impl Into<D3DDISPLAYMODEFILTER>, ) -> u32
[docs.microsoft.com] IDirect3D9Ex::GetAdapterModeCountEx
Returns the number of display modes available.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.