From ad2d99df30711c6891dc227c209f89945ac603a3 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:19 +0100 Subject: feat(render): add surface to renderer type --- stockton-render/src/lib.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stockton-render/src/lib.rs b/stockton-render/src/lib.rs index d399a76..de98360 100644 --- a/stockton-render/src/lib.rs +++ b/stockton-render/src/lib.rs @@ -35,9 +35,6 @@ extern crate gfx_backend_metal as back; #[cfg(feature = "vulkan")] extern crate gfx_backend_vulkan as back; -#[cfg(feature = "empty")] -extern crate gfx_backend_empty as back; - extern crate gfx_hal as hal; extern crate stockton_types; extern crate winit; @@ -46,7 +43,8 @@ use stockton_types::World; use winit::Window; -use back::Instance; +use back::{Instance}; +use back::{Backend}; use std::sync::{Arc, RwLock}; @@ -54,13 +52,17 @@ pub struct Renderer<'a> { world: Arc>>, instance: Instance, window: &'a Window, + surface: ::Surface } impl<'a> Renderer<'a> { pub fn new(world: Arc>>, window: &'a Window) -> Renderer<'a> { let instance = Instance::create("stockton", 1); + + let surface = instance.create_surface(&window); + Renderer { - world, window, instance + world, window, instance, surface } } } -- cgit v1.2.3