Remove redundant code

This commit is contained in:
Hanno Braun 2025-03-25 20:27:43 +01:00
parent 7940ec81d4
commit 29c3111963
4 changed files with 4 additions and 25 deletions

View File

@ -15,7 +15,7 @@ use winit::{
use crate::{
RendererInitError,
input::{DEFAULT_CAMERA_TUNING_CONFIG, InputEvent},
screen::{Screen, ScreenSize},
screen::ScreenSize,
viewer::ViewerWindow,
window::{self, Window},
};

View File

@ -4,11 +4,7 @@ use thiserror::Error;
use tracing::{error, trace};
use wgpu::util::DeviceExt as _;
use crate::{
camera::Camera,
screen::{Screen, ScreenSize},
window::Window,
};
use crate::{camera::Camera, screen::ScreenSize, window::Window};
use super::{
DEPTH_FORMAT, DeviceError, SAMPLE_COUNT, device::Device,

View File

@ -1,18 +1,5 @@
//! Types that describe aspects of the screen
use std::sync::Arc;
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
/// Needs to be implemented by types that can serve as a screen to render to
pub trait Screen {
/// The window
type Window: HasDisplayHandle + HasWindowHandle + Send + Sync + 'static;
/// Access the window
fn window(&self) -> Arc<Self::Window>;
}
/// Cursor position in normalized coordinates (-1 to +1)
///
/// The center of the screen is at (0, 0). The aspect ratio is taken into

View File

@ -2,7 +2,7 @@ use std::sync::Arc;
use winit::event_loop::ActiveEventLoop;
use crate::screen::{Screen, ScreenSize};
use crate::screen::ScreenSize;
/// A window that can be used with `fj-viewer`
pub struct Window {
@ -53,12 +53,8 @@ impl Window {
height: size.height,
}
}
}
impl Screen for Window {
type Window = winit::window::Window;
fn window(&self) -> Arc<Self::Window> {
pub fn window(&self) -> Arc<winit::window::Window> {
self.inner.clone()
}
}