aboutsummaryrefslogtreecommitdiff
path: root/stockton-render/src/lib.rs
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:20 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:20 +0100
commit51168c753286eeee64410ab19dc9f78a4ea479e4 (patch)
treed384093c6fd11b36b189013b663f3500b18ec2a4 /stockton-render/src/lib.rs
parentd076d3a6fd484e298915cd85609ba9706abacc87 (diff)
refactor(all): use new traits-based levels everywhere else.
unfortunately this also starts using an unstable feature - generic_associated_types see rust-lang/rust#44265
Diffstat (limited to 'stockton-render/src/lib.rs')
-rw-r--r--stockton-render/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/stockton-render/src/lib.rs b/stockton-render/src/lib.rs
index 3f157a1..1abc408 100644
--- a/stockton-render/src/lib.rs
+++ b/stockton-render/src/lib.rs
@@ -26,7 +26,7 @@ extern crate image;
extern crate log;
extern crate stockton_types;
-extern crate stockton_bsp;
+extern crate stockton_levels;
extern crate arrayvec;
@@ -36,22 +36,23 @@ mod types;
mod culling;
use stockton_types::World;
+use stockton_levels::prelude::*;
use error::{CreationError, FrameError};
use draw::RenderingContext;
use culling::get_visible_faces;
/// Renders a world to a window when you tell it to.
-pub struct Renderer<'a> {
- world: World,
+pub struct Renderer<'a, T: MinBSPFeatures> {
+ world: World<T>,
pub context: RenderingContext<'a>
}
-impl<'a> Renderer<'a> {
+impl<'a, T: MinBSPFeatures> Renderer<'a, T> {
/// Create a new Renderer.
/// This initialises all the vulkan context, etc needed.
- pub fn new(world: World, window: &winit::window::Window) -> Result<Self, CreationError> {
+ pub fn new(world: World<T>, window: &winit::window::Window) -> Result<Self, CreationError> {
let context = RenderingContext::new(window)?;
Ok(Renderer {