Move state stuff to its own folder

This commit is contained in:
Sijmen 2021-05-31 18:34:09 +02:00
parent bf22190ccd
commit 0d7df1d501
Signed by: vijfhoek
GPG key ID: 82D05C89B28B0DAE
4 changed files with 8 additions and 6 deletions

View file

@ -1,7 +1,6 @@
mod camera;
mod chunk;
mod cube;
mod hud_state;
mod light;
mod quad;
mod state;
@ -9,7 +8,6 @@ mod texture;
mod uniforms;
mod vertex;
mod world;
mod world_state;
use std::time::{Duration, Instant};
use wgpu::SwapChainError;

View file

@ -88,7 +88,7 @@ impl HudState {
let texture = Texture::from_bytes(
render_device,
render_queue,
include_bytes!("../assets/gui/widgets.png"),
include_bytes!("../../assets/gui/widgets.png"),
"Texture GUI widgets",
)
.unwrap();
@ -151,7 +151,7 @@ impl HudState {
let module = &render_device.create_shader_module(&wgpu::ShaderModuleDescriptor {
label: Some("UI shader"),
flags: wgpu::ShaderFlags::all(),
source: wgpu::ShaderSource::Wgsl(include_str!("shaders/ui.wgsl").into()),
source: wgpu::ShaderSource::Wgsl(include_str!("../shaders/ui.wgsl").into()),
});
let pipeline_layout =

View file

@ -1,3 +1,6 @@
mod hud;
mod world;
use std::time::Duration;
use cgmath::{InnerSpace, Rad};
@ -6,7 +9,8 @@ use winit::{
window::Window,
};
use crate::{hud_state::HudState, world_state::WorldState};
use hud::HudState;
use world::WorldState;
pub struct State {
pub window_size: winit::dpi::PhysicalSize<u32>,

View file

@ -161,7 +161,7 @@ impl WorldState {
&(wgpu::ShaderModuleDescriptor {
label: Some("shader"),
flags: wgpu::ShaderFlags::all(),
source: wgpu::ShaderSource::Wgsl(include_str!("shaders/world.wgsl").into()),
source: wgpu::ShaderSource::Wgsl(include_str!("../shaders/world.wgsl").into()),
}),
);