#[non_exhaustive]pub struct Instance { /* private fields */ }Expand description
The single instance for using citro3d. This is the base type that an application
should instantiate to use this library.
Implementations§
Source§impl Instance
impl Instance
Sourcepub fn with_cmdbuf_size(size: usize) -> Result<Self>
pub fn with_cmdbuf_size(size: usize) -> Result<Self>
Initialize the instance with a specified command buffer size.
§Errors
Fails if citro3d cannot be initialized.
Sourcepub fn render_target<'screen>(
&self,
width: usize,
height: usize,
screen: RefMut<'screen, dyn Screen>,
depth_format: Option<DepthFormat>,
) -> Result<Target<'screen>>
pub fn render_target<'screen>( &self, width: usize, height: usize, screen: RefMut<'screen, dyn Screen>, depth_format: Option<DepthFormat>, ) -> Result<Target<'screen>>
Create a new render target with the specified size, color format, and depth format.
§Errors
Fails if the target could not be created with the given parameters.
Sourcepub fn render_frame_with<'istance: 'frame, 'frame>(
&'istance mut self,
f: impl FnOnce(RenderPass<'frame>) -> RenderPass<'frame>,
)
pub fn render_frame_with<'istance: 'frame, 'frame>( &'istance mut self, f: impl FnOnce(RenderPass<'frame>) -> RenderPass<'frame>, )
Render a frame.
The passed in function/closure can access a RenderPass to emit draw calls.