Struct mage_core::app::PresentInput
source · pub struct PresentInput<'textures> {
pub width: u32,
pub height: u32,
pub fore_image: &'textures mut [u32],
pub back_image: &'textures mut [u32],
pub text_image: &'textures mut [u32],
}
Expand description
The PresentInput
struct is passed to the [present
] method of the
App
trait to provide information about the current frame.
Fields§
§width: u32
The width of the window in characters.
height: u32
The height of the window in characters.
fore_image: &'textures mut [u32]
The foreground color of each character. Each 32-bit RGBA value represents a single character. The least significant 8 bits are the red value, the next 8 bits are the green value, the next 8 bits are the blue value, and the most significant 8 bits are the alpha value. The alpha value is currently unused.
back_image: &'textures mut [u32]
The background color of each character. Each 32-bit RGBA value represents a single character. The least significant 8 bits are the red value, the next 8 bits are the green value, the next 8 bits are the blue value, and the most significant 8 bits are the alpha value. The alpha value is currently unused.
text_image: &'textures mut [u32]
The character buffer. Each 32-bit RGBA value represents a single character. The least significant 8 bits are the ASCII value of the character, and the most significant 24 bits are unused by the engine but are available for use by the game.
Implementations§
source§impl<'t> PresentInput<'t>
impl<'t> PresentInput<'t>
pub fn rect(&self) -> Rect
pub fn new_image(&self) -> Image
sourcepub fn blit(
&mut self,
dst_rect: Rect,
src_rect: Rect,
src_image: &Image,
paper: u32
)
pub fn blit( &mut self, dst_rect: Rect, src_rect: Rect, src_image: &Image, paper: u32 )
Blit the an area of the source image to the screen.
The source rectangle is clipped to the source image.
Arguments
dst_rect
- Where to blit the source image to on the screen.src_rect
- The area of the source image to blit.src_image
- The source image to blit from.paper
- The paper colour to use outside the source image. This will also be used as the ink colour.
pub fn clear(&mut self, rect: Rect, paper: u32)
pub fn blit_internal( &mut self, dst_rect: Rect, src_rect: Rect, src_image: &Image )
Trait Implementations§
source§impl<'textures> Debug for PresentInput<'textures>
impl<'textures> Debug for PresentInput<'textures>
source§impl<'textures> PartialEq for PresentInput<'textures>
impl<'textures> PartialEq for PresentInput<'textures>
source§fn eq(&self, other: &PresentInput<'textures>) -> bool
fn eq(&self, other: &PresentInput<'textures>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<'textures> Eq for PresentInput<'textures>
impl<'textures> StructuralEq for PresentInput<'textures>
impl<'textures> StructuralPartialEq for PresentInput<'textures>
Auto Trait Implementations§
impl<'textures> RefUnwindSafe for PresentInput<'textures>
impl<'textures> Send for PresentInput<'textures>
impl<'textures> Sync for PresentInput<'textures>
impl<'textures> Unpin for PresentInput<'textures>
impl<'textures> !UnwindSafe for PresentInput<'textures>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.