renderer struct that handles engine objects like samplers, textures
This commit is contained in:
parent
81c6b6f4ee
commit
b404b50b62
|
@ -2054,6 +2054,32 @@ impl EguiState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct Renderer2 {
|
||||||
|
device: Device,
|
||||||
|
samplers: SamplerCache,
|
||||||
|
texture_managers: texture::TextureManager,
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
|
// keep this around because the vulkan device has been created with this
|
||||||
|
// display handle in mind. Might not be necessary.
|
||||||
|
display: RawDisplayHandle,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Renderer2 {
|
||||||
|
pub fn new(display: RawDisplayHandle) -> Result<Self> {
|
||||||
|
let device = Device::new_from_default_desc(Some(display))?;
|
||||||
|
|
||||||
|
Ok(Self {
|
||||||
|
samplers: SamplerCache::new(device.clone()),
|
||||||
|
texture_managers: texture::TextureManager::new(device.clone()),
|
||||||
|
display,
|
||||||
|
device,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//pub fn create_surface
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Renderer<W> {
|
pub struct Renderer<W> {
|
||||||
pub texture_handler: texture::TextureManager,
|
pub texture_handler: texture::TextureManager,
|
||||||
pub egui_state: EguiState,
|
pub egui_state: EguiState,
|
||||||
|
|
Loading…
Reference in a new issue