aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:19 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:19 +0100
commitad2d99df30711c6891dc227c209f89945ac603a3 (patch)
tree51590ca9f67883afed60b75ab5010d9eefbcf1e9
parent3801068f8d72dfb6e71e29ddbe69bba8f6913743 (diff)
feat(render): add surface to renderer type
-rw-r--r--stockton-render/src/lib.rs12
1 files 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<RwLock<World<'a>>>,
instance: Instance,
window: &'a Window,
+ surface: <Backend as hal::Backend>::Surface
}
impl<'a> Renderer<'a> {
pub fn new(world: Arc<RwLock<World<'a>>>, 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
}
}
}