Compare commits

...

4 Commits

Author SHA1 Message Date
eece7b275b Merge branch 'fixes' 2026-08-04 22:13:44 +03:00
9a695c06b5 update Cargo.lock on morph 2026-08-04 22:13:11 +03:00
187019a318 use Default to avoid breaking fallback main 2026-08-04 21:52:28 +03:00
f2b904b5f9 replace README on morph 2026-08-04 21:52:28 +03:00
3 changed files with 17 additions and 5 deletions

View File

@ -54,6 +54,9 @@ git remote remove origin
git rm --cached init.sh
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 /)
htmlname=$(echo -n "$name" | sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s:[\\/&]:\\&:g')
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}')
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"

View File

@ -1,6 +1,6 @@
use std::error::Error;
use glam::{UVec2, Vec4};
use glam::{UVec2, Vec4, vec4};
const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth16Unorm;
const OUTPUT_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Bgra8UnormSrgb;
@ -11,6 +11,14 @@ pub struct RedrawArgs {
pub background: Vec4,
}
impl Default for RedrawArgs {
fn default() -> Self {
Self {
background: vec4(0.05, 0.20, 0.85, 1.00),
}
}
}
pub struct Gpu {
device: wgpu::Device,
queue: wgpu::Queue,

View File

@ -1,7 +1,7 @@
use std::sync::Arc;
use PROJECT_NAME::{Core, RedrawArgs, init_gpu_inner};
use glam::{uvec2, vec4};
use glam::uvec2;
use winit::{
application::ApplicationHandler,
event::WindowEvent,
@ -36,9 +36,7 @@ impl MainWindow {
WindowEvent::Resized(physical_size) => self
.core
.configure(uvec2(physical_size.width, physical_size.height)),
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs {
background: vec4(0.05, 0.20, 0.85, 1.00),
}),
WindowEvent::RedrawRequested => self.core.redraw(&RedrawArgs::default()),
_ => {}
}
}