spitfire_glow::graphics

Struct Graphics

Source
pub struct Graphics<V: GlowVertexAttribs> {
    pub main_camera: Camera,
    pub color: [f32; 4],
    pub stream: VertexStream<V, GraphicsBatch>,
    /* private fields */
}

Fields§

§main_camera: Camera§color: [f32; 4]§stream: VertexStream<V, GraphicsBatch>

Implementations§

Source§

impl<V: GlowVertexAttribs> Graphics<V>

Source

pub fn new(context: Context) -> Self

Source

pub fn context(&self) -> Option<Ref<'_, Context>>

Source

pub fn surface( &self, attachments: Vec<SurfaceAttachment>, ) -> Result<Surface, String>

Source

pub fn pixel_texture(&self, color: [u8; 3]) -> Result<Texture, String>

Source

pub fn texture( &self, width: u32, height: u32, depth: u32, format: GlowTextureFormat, data: Option<&[u8]>, ) -> Result<Texture, String>

Source

pub fn shader(&self, vertex: &str, fragment: &str) -> Result<Shader, String>

Source

pub fn prepare_frame(&self, clear: bool) -> Result<(), String>

Source

pub fn draw(&mut self) -> Result<(), String>

Source

pub fn push_surface(&mut self, surface: Surface) -> Result<(), String>

Source

pub fn pop_surface(&mut self) -> Result<Option<Surface>, String>

Trait Implementations§

Source§

impl<V: GlowVertexAttribs> Drop for Graphics<V>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<V> Freeze for Graphics<V>

§

impl<V> !RefUnwindSafe for Graphics<V>

§

impl<V> !Send for Graphics<V>

§

impl<V> !Sync for Graphics<V>

§

impl<V> Unpin for Graphics<V>
where V: Unpin,

§

impl<V> !UnwindSafe for Graphics<V>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.