#[repr(transparent)]pub struct Lock(_);
Expand description
[docs.microsoft.com] DWORD / D3DLOCK_*
A combination of zero or more locking options that describe the type of lock to perform.
Implementations
sourceimpl Lock
impl Lock
sourcepub const fn from_unchecked(d3d: u32) -> Self
pub const fn from_unchecked(d3d: u32) -> Self
Convert from an underlying [winapi] D3D...
type.
This is probably safe… probably…
sourcepub const fn into_inner(self) -> u32
pub const fn into_inner(self) -> u32
Convert back into an underlying [winapi] D3D...
type.
sourceimpl Lock
impl Lock
sourcepub const Discard: Lock = Lock(D3DLOCK_DISCARD)
pub const Discard: Lock = Lock(D3DLOCK_DISCARD)
The application discards all memory within the locked region. For vertex and index buffers, the entire buffer will be discarded. This option is only valid when the resource is created with [Usage::Dynamic].
sourcepub const DoNotWait: Lock = Lock(D3DLOCK_DONOTWAIT)
pub const DoNotWait: Lock = Lock(D3DLOCK_DONOTWAIT)
Allows an application to gain back CPU cycles if the driver cannot lock the surface immediately. If this flag is set and the driver cannot lock the surface immediately, the lock call will return D3DERR::WASSTILLDRAWING. This flag can only be used when locking a surface created using [IDirect3DDevice9Ext::create_offscreen_plain_surface], [IDirect3DDevice9Ext::create_render_target], or [IDirect3DDevice9Ext::create_depth_stencil_surface]. This flag can also be used with a back buffer.
sourcepub const NoDirtyUpdate: Lock = Lock(D3DLOCK_NO_DIRTY_UPDATE)
pub const NoDirtyUpdate: Lock = Lock(D3DLOCK_NO_DIRTY_UPDATE)
By default, a lock on a resource adds a dirty region to that resource. This option prevents any changes to the dirty state of the resource. Applications should use this option when they have additional information about the set of regions changed during the lock operation.
sourcepub const NoOverwrite: Lock = Lock(D3DLOCK_NOOVERWRITE)
pub const NoOverwrite: Lock = Lock(D3DLOCK_NOOVERWRITE)
Indicates that memory that was referred to in a drawing call since the last lock without this flag will not be modified during the lock. This can enable optimizations when the application is appending data to a resource. Specifying this flag enables the driver to return immediately if the resource is in use, otherwise, the driver must finish using the resource before returning from locking.
sourcepub const NoSysLock: Lock = Lock(D3DLOCK_NOSYSLOCK)
pub const NoSysLock: Lock = Lock(D3DLOCK_NOSYSLOCK)
The default behavior of a video memory lock is to reserve a system-wide critical section, guaranteeing that no display mode changes will occur for the duration of the lock. This option causes the system-wide critical section not to be held for the duration of the lock.
The lock operation is time consuming, but can enable the system to perform other duties, such as moving the mouse cursor. This option is useful for long-duration locks, such as the lock of the back buffer for software rendering that would otherwise adversely affect system responsiveness.
Trait Implementations
sourceimpl BitOrAssign<Lock> for Lock
impl BitOrAssign<Lock> for Lock
sourcefn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the |=
operation. Read more
sourceimpl Ord for Lock
impl Ord for Lock
sourceimpl PartialOrd<Lock> for Lock
impl PartialOrd<Lock> for Lock
sourcefn partial_cmp(&self, other: &Lock) -> Option<Ordering>
fn partial_cmp(&self, other: &Lock) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Lock
impl Eq for Lock
impl Pod for Lock
impl StructuralEq for Lock
impl StructuralPartialEq for Lock
Auto Trait Implementations
impl RefUnwindSafe for Lock
impl Send for Lock
impl Sync for Lock
impl Unpin for Lock
impl UnwindSafe for Lock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more