Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

VramRegionSource

Trait VramRegionSource 

Source
pub trait VramRegionSource {
    // Required methods
    fn alloc_page_run(
        &mut self,
        count: u16,
        depth: TextureDepth,
        page_y: u16,
    ) -> Option<(TexturePage, VramHandle)>;
    fn alloc_clut(&mut self, entries: u16) -> Option<(Clut, VramHandle)>;
}
Expand description

Source of VRAM regions for crates that should not depend on the whole VramAllocator type (e.g. psx-font). VramAllocator implements it.

Required Methods§

Source

fn alloc_page_run( &mut self, count: u16, depth: TextureDepth, page_y: u16, ) -> Option<(TexturePage, VramHandle)>

Reserve count contiguous texture pages at page row page_y (0 or 256), returning the base TexturePage and a free handle.

Source

fn alloc_clut(&mut self, entries: u16) -> Option<(Clut, VramHandle)>

Reserve a CLUT of entries palette slots (16 for 4bpp, 256 for 8bpp).

Implementors§

Source§

impl<const ROOM_PAGES: usize, const CLUT_ROWS: usize> VramRegionSource for VramAllocator<ROOM_PAGES, CLUT_ROWS>