remove graphics stuff from main
This commit is contained in:
parent
85b70331fd
commit
0bf253aa11
@ -39,27 +39,11 @@ pub trait Example: 'static + Sized {
|
|||||||
fn required_limits() -> wgpu::Limits {
|
fn required_limits() -> wgpu::Limits {
|
||||||
wgpu::Limits::downlevel_webgl2_defaults() // These downlevel limits will allow the code to run on all possible hardware
|
wgpu::Limits::downlevel_webgl2_defaults() // These downlevel limits will allow the code to run on all possible hardware
|
||||||
}
|
}
|
||||||
fn init(
|
fn init() -> Self;
|
||||||
config: &wgpu::SurfaceConfiguration,
|
fn resize(&mut self);
|
||||||
adapter: &wgpu::Adapter,
|
fn update(&mut self, window: &winit::window::Window, event: WindowEvent);
|
||||||
device: &wgpu::Device,
|
|
||||||
queue: &wgpu::Queue,
|
|
||||||
) -> Self;
|
|
||||||
fn resize(
|
|
||||||
&mut self,
|
|
||||||
config: &wgpu::SurfaceConfiguration,
|
|
||||||
device: &wgpu::Device,
|
|
||||||
queue: &wgpu::Queue,
|
|
||||||
);
|
|
||||||
fn update(&mut self, window: &winit::window::Window, device: &wgpu::Device, queue: &wgpu::Queue, event: WindowEvent);
|
|
||||||
fn device_event(&mut self, window: &winit::window::Window, event: DeviceEvent);
|
fn device_event(&mut self, window: &winit::window::Window, event: DeviceEvent);
|
||||||
fn render(
|
fn render(&self);
|
||||||
&mut self,
|
|
||||||
view: &wgpu::TextureView,
|
|
||||||
device: &wgpu::Device,
|
|
||||||
queue: &wgpu::Queue,
|
|
||||||
spawner: &Spawner,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Setup {
|
struct Setup {
|
||||||
@ -298,7 +282,7 @@ fn start<E: Example>(
|
|||||||
surface.configure(&device, &config);
|
surface.configure(&device, &config);
|
||||||
|
|
||||||
log::info!("Initializing the example...");
|
log::info!("Initializing the example...");
|
||||||
let mut example = E::init(&config, &adapter, &device, &queue);
|
let mut example=E::init();
|
||||||
|
|
||||||
log::info!("Entering render loop...");
|
log::info!("Entering render loop...");
|
||||||
event_loop.run(move |event, _, control_flow| {
|
event_loop.run(move |event, _, control_flow| {
|
||||||
|
@ -93,12 +93,7 @@ impl framework::Example for GlobalState {
|
|||||||
fn required_limits() -> wgpu::Limits {
|
fn required_limits() -> wgpu::Limits {
|
||||||
wgpu::Limits::default() //framework.rs was using goofy limits that caused me a multi-day headache
|
wgpu::Limits::default() //framework.rs was using goofy limits that caused me a multi-day headache
|
||||||
}
|
}
|
||||||
fn init(
|
fn init() -> Self {
|
||||||
config: &wgpu::SurfaceConfiguration,
|
|
||||||
_adapter: &wgpu::Adapter,
|
|
||||||
device: &wgpu::Device,
|
|
||||||
queue: &wgpu::Queue,
|
|
||||||
) -> Self {
|
|
||||||
//wee
|
//wee
|
||||||
let user_settings=settings::read_user_settings();
|
let user_settings=settings::read_user_settings();
|
||||||
let mut indexed_models = Vec::new();
|
let mut indexed_models = Vec::new();
|
||||||
@ -190,7 +185,7 @@ impl framework::Example for GlobalState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::single_match)]
|
#[allow(clippy::single_match)]
|
||||||
fn update(&mut self, window: &winit::window::Window, device: &wgpu::Device, queue: &wgpu::Queue, event: winit::event::WindowEvent) {
|
fn update(&mut self, window: &winit::window::Window, event: winit::event::WindowEvent) {
|
||||||
let time=integer::Time::from_nanos(self.start_time.elapsed().as_nanos() as i64);
|
let time=integer::Time::from_nanos(self.start_time.elapsed().as_nanos() as i64);
|
||||||
match event {
|
match event {
|
||||||
winit::event::WindowEvent::DroppedFile(path)=>{
|
winit::event::WindowEvent::DroppedFile(path)=>{
|
||||||
|
Loading…
Reference in New Issue
Block a user