summaryrefslogtreecommitdiff
path: root/alligator_render/examples/bunnymark.rs
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-02-04 13:25:45 -0500
committerMicha White <botahamec@outlook.com>2023-02-04 13:25:45 -0500
commit9fd7d6689d5d90679e4b0c12e463ef4e2f8bf515 (patch)
treea0b127f1094b72d0966c2edea3d171e74001c875 /alligator_render/examples/bunnymark.rs
parent518a87ddb2e6ce908affce2773fc7f92beb52c73 (diff)
Have the renderer take the texture manager
Diffstat (limited to 'alligator_render/examples/bunnymark.rs')
-rw-r--r--alligator_render/examples/bunnymark.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/alligator_render/examples/bunnymark.rs b/alligator_render/examples/bunnymark.rs
index 5530ef3..ab38b5e 100644
--- a/alligator_render/examples/bunnymark.rs
+++ b/alligator_render/examples/bunnymark.rs
@@ -3,6 +3,7 @@ use std::{num::NonZeroU32, time::Instant};
use alligator_render::{
ImageFormat, Instance, InstanceId, RenderWindowConfig, Renderer, TextureId,
};
+use alligator_resources::texture::{TextureManager, TextureManagerConfig};
fn xorshift_plus(seed: &mut [u64; 2]) -> u64 {
let mut t = seed[0];
@@ -123,7 +124,7 @@ fn main() {
profiling::register_thread!("main");
// configure the render window
- let config = RenderWindowConfig {
+ let render_config = RenderWindowConfig {
title: "BunnyMark",
instance_capacity: 5_000_000,
default_width: NonZeroU32::new(1280).unwrap(),
@@ -133,8 +134,16 @@ fn main() {
..Default::default()
};
+ let texture_config = TextureManagerConfig {
+ initial_capacity: 1,
+ max_size: 10_000,
+ atlas_width: 100,
+ atlas_height: 100,
+ };
+
let bunny = include_bytes!("res/bunny.ff");
- let mut renderer = Renderer::new(&config).unwrap();
+ let texture_manager = TextureManager::new(&texture_config);
+ let mut renderer = Renderer::new(&render_config, texture_manager).unwrap();
let texture_id = renderer
.textures_mut()
.load_from_memory(bunny, ImageFormat::Farbfeld)