mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 18:38:28 +00:00
Remove redundant code
This commit is contained in:
parent
7940ec81d4
commit
29c3111963
@ -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},
|
||||
};
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user