pub enum DrawTarget {
    Default {
        rect: FramebufferIntRect,
        total_size: FramebufferIntSize,
        surface_origin_is_top_left: bool,
    },
    Texture {
        dimensions: DeviceIntSize,
        with_depth: bool,
        fbo_id: FBOId,
        id: GLuint,
        target: GLuint,
    },
    External {
        fbo: FBOId,
        size: FramebufferIntSize,
    },
    NativeSurface {
        offset: DeviceIntPoint,
        external_fbo_id: u32,
        dimensions: DeviceIntSize,
    },
}Expand description
Contains the parameters necessary to bind a draw target.
Variants§
Default
Use the device’s default draw target, with the provided dimensions, which are used to set the viewport.
Fields
§
rect: FramebufferIntRectTarget rectangle to draw.
§
total_size: FramebufferIntSizeTotal size of the target.
Texture
Use the provided texture.
Fields
§
dimensions: DeviceIntSizeSize of the texture in pixels
External
Use an FBO attached to an external texture.
NativeSurface
An OS compositor surface
Implementations§
Source§impl DrawTarget
 
impl DrawTarget
pub fn new_default( size: DeviceIntSize, surface_origin_is_top_left: bool, ) -> Self
Sourcepub fn is_default(&self) -> bool
 
pub fn is_default(&self) -> bool
Returns true if this draw target corresponds to the default framebuffer.
pub fn from_texture(texture: &Texture, with_depth: bool) -> Self
Sourcepub fn dimensions(&self) -> DeviceIntSize
 
pub fn dimensions(&self) -> DeviceIntSize
Returns the dimensions of this draw-target.
pub fn offset(&self) -> DeviceIntPoint
pub fn to_framebuffer_rect( &self, device_rect: DeviceIntRect, ) -> FramebufferIntRect
pub fn surface_origin_is_top_left(&self) -> bool
Sourcepub fn build_scissor_rect(
    &self,
    scissor_rect: Option<DeviceIntRect>,
) -> FramebufferIntRect
 
pub fn build_scissor_rect( &self, scissor_rect: Option<DeviceIntRect>, ) -> FramebufferIntRect
Given a scissor rect, convert it to the right coordinate space depending on the draw target kind. If no scissor rect was supplied, returns a scissor rect that encloses the entire render target.
Trait Implementations§
Source§impl Clone for DrawTarget
 
impl Clone for DrawTarget
Source§fn clone(&self) -> DrawTarget
 
fn clone(&self) -> DrawTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for DrawTarget
 
impl Debug for DrawTarget
Source§impl From<DrawTarget> for ReadTarget
 
impl From<DrawTarget> for ReadTarget
Source§fn from(t: DrawTarget) -> Self
 
fn from(t: DrawTarget) -> Self
Converts to this type from the input type.
impl Copy for DrawTarget
Auto Trait Implementations§
impl Freeze for DrawTarget
impl RefUnwindSafe for DrawTarget
impl Send for DrawTarget
impl Sync for DrawTarget
impl Unpin for DrawTarget
impl UnwindSafe for DrawTarget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more