Compare commits
4 Commits
19ccdcba5f
...
eece7b275b
| Author | SHA1 | Date | |
|---|---|---|---|
| eece7b275b | |||
| 9a695c06b5 | |||
| 187019a318 | |||
| f2b904b5f9 |
6
init.sh
6
init.sh
|
|
@ -54,6 +54,9 @@ git remote remove origin
|
||||||
git rm --cached init.sh
|
git rm --cached init.sh
|
||||||
git rm -r skel-test
|
git rm -r skel-test
|
||||||
|
|
||||||
|
# replace the README with a stub
|
||||||
|
echo "# $name" >| README.md
|
||||||
|
|
||||||
# escape HTML special characters (&, <, and >), but also sed special characters (& again, \, and /)
|
# escape HTML special characters (&, <, and >), but also sed special characters (& again, \, and /)
|
||||||
htmlname=$(echo -n "$name" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s:[\\/&]:\\&:g')
|
htmlname=$(echo -n "$name" | sed 's/&/\&/g; s/</\</g; s/>/\>/g; s:[\\/&]:\\&:g')
|
||||||
sed -i "s/PROJECT NAME/$htmlname/" ui/src/main_window.ui
|
sed -i "s/PROJECT NAME/$htmlname/" ui/src/main_window.ui
|
||||||
|
|
@ -73,4 +76,7 @@ grep -l -r PROJECT_NAME | xargs sed -i "s/PROJECT_NAME/$ident/g"
|
||||||
pascal=$(echo -n $ident | LC_ALL=C tr '_' '\n' | LC_ALL=C awk -v FIELDWIDTHS='1 1000' -v ORS='' '{print toupper($1) $2}')
|
pascal=$(echo -n $ident | LC_ALL=C tr '_' '\n' | LC_ALL=C awk -v FIELDWIDTHS='1 1000' -v ORS='' '{print toupper($1) $2}')
|
||||||
grep -l -r PROJECTNAME | xargs sed -i "s/PROJECTNAME/$pascal/g"
|
grep -l -r PROJECTNAME | xargs sed -i "s/PROJECTNAME/$pascal/g"
|
||||||
|
|
||||||
|
# another hack, to update Cargo.lock
|
||||||
|
cargo tree >/dev/null
|
||||||
|
|
||||||
git commit -a -m "MORPH INTO: $name"
|
git commit -a -m "MORPH INTO: $name"
|
||||||
|
|
|
||||||
10
src/lib.rs
10
src/lib.rs
|
|
@ -1,6 +1,6 @@
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
|
||||||
use glam::{UVec2, Vec4};
|
use glam::{UVec2, Vec4, vec4};
|
||||||
|
|
||||||
const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth16Unorm;
|
const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth16Unorm;
|
||||||
const OUTPUT_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8UnormSrgb;
|
const OUTPUT_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8UnormSrgb;
|
||||||
|
|
@ -11,6 +11,14 @@ pub struct RedrawArgs {
|
||||||
pub background: Vec4,
|
pub background: Vec4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for RedrawArgs {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
background: vec4(0.05, 0.20, 0.85, 1.00),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct Gpu {
|
pub struct Gpu {
|
||||||
device: wgpu::Device,
|
device: wgpu::Device,
|
||||||
queue: wgpu::Queue,
|
queue: wgpu::Queue,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
|
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
|
||||||
use glam::{uvec2, vec4};
|
use glam::uvec2;
|
||||||
use winit::{
|
use winit::{
|
||||||
application::ApplicationHandler,
|
application::ApplicationHandler,
|
||||||
event::WindowEvent,
|
event::WindowEvent,
|
||||||
|
|
@ -36,9 +36,7 @@ impl MainWindow {
|
||||||
WindowEvent::Resized(physical_size) => self
|
WindowEvent::Resized(physical_size) => self
|
||||||
.core
|
.core
|
||||||
.configure(uvec2(physical_size.width, physical_size.height)),
|
.configure(uvec2(physical_size.width, physical_size.height)),
|
||||||
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs {
|
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs::default()),
|
||||||
background: vec4(0.05, 0.20, 0.85, 1.00),
|
|
||||||
}),
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user