Skip to main content

Resources

Struct Resources 

Source
pub struct Resources<'a> { /* private fields */ }
Expand description

Borrowed GPU resource allocator valid during create_tile_resources and prepare.

Implementations§

Source§

impl<'a> Resources<'a>

Source

pub fn create_program(&mut self, desc: &ProgramDesc<'_>) -> Result<Program>

Source

pub fn create_ground_heights(&mut self) -> Result<GroundHeights>

Source

pub fn create_vertices( &mut self, bytes: &[u8], vertex_count: usize, stride: u32, ) -> Result<VertexBuffer>

Source

pub fn create_dynamic_vertices( &mut self, bytes: &[u8], vertex_count: usize, stride: u32, ) -> Result<VertexBuffer>

Source

pub fn update_vertices(&mut self, buffer: &VertexBuffer, bytes: &[u8]) -> bool

Source

pub fn create_indexes(&mut self, indexes: &[u16]) -> Result<IndexBuffer>

Source

pub fn quad_indexes(&mut self) -> Result<IndexBuffer>

Source

pub fn create_texture( &mut self, format: TextureFormat, sampler: SamplerState, ) -> Result<Texture>

Source

pub fn write_texture( &mut self, texture: &Texture, data: &[u8], width: u32, height: u32, ) -> Result<()>

Source

pub fn create_target( &mut self, width: u32, height: u32, channel_type: TextureChannelType, clear_color: Color, ) -> Result<Target>

Source

pub fn create_mesh(&mut self, desc: &MeshDesc<'_>) -> Result<Mesh>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Resources<'a>

§

impl<'a> !Send for Resources<'a>

§

impl<'a> !Sync for Resources<'a>

§

impl<'a> !UnwindSafe for Resources<'a>

§

impl<'a> Forget for Resources<'a>

§

impl<'a> Freeze for Resources<'a>
where &'a mut dyn ResourcesBackend: Freeze,

§

impl<'a> Move for Resources<'a>

§

impl<'a> Unpin for Resources<'a>
where &'a mut dyn ResourcesBackend: Unpin,

§

impl<'a> UnsafeUnpin for Resources<'a>
where &'a mut dyn ResourcesBackend: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.