Compare commits
3 Commits
165a90eba1
...
846a082f79
| Author | SHA1 | Date | |
|---|---|---|---|
| 846a082f79 | |||
| d1373fc061 | |||
| c0b1c2e135 |
@@ -32,3 +32,4 @@ winit = "0.22.0"
|
|||||||
hprof = "0.1.3"
|
hprof = "0.1.3"
|
||||||
rusttype = { version = "0.7.0", features = ["gpu_cache"] }
|
rusttype = { version = "0.7.0", features = ["gpu_cache"] }
|
||||||
vulkano_text = "0.12.0"
|
vulkano_text = "0.12.0"
|
||||||
|
petgraph = "0.5.1"
|
||||||
@@ -10,14 +10,16 @@ Creation-Date: 2020-02-03T22:11:42-08:00
|
|||||||
TODO:
|
TODO:
|
||||||
[X] Text rendering is mocked.
|
[X] Text rendering is mocked.
|
||||||
[?] Pathfinder vulkan backend implementation
|
[?] Pathfinder vulkan backend implementation
|
||||||
* Kinda big meh on this. It's very much oneshot based
|
* Kinda big meh on this. It's very much oneshot based
|
||||||
and not incredibly compatible with vulkano...
|
and not incredibly compatible with vulkano...
|
||||||
[ ] Investigate lyon maybe
|
[ ] Investigate lyon maybe
|
||||||
[X] Currently using local copies of a few libraries:
|
[ ] Event system
|
||||||
|
[ ] HTML like layout scripts
|
||||||
|
[x] Currently using local copies of a few libraries:
|
||||||
[x] shade_runner ( not gonna happen, my fork has diverged too far )
|
[x] shade_runner ( not gonna happen, my fork has diverged too far )
|
||||||
[ ] Make a toolpath
|
[ ] Make a toolpath
|
||||||
[X] Read from GPU?
|
[X] Read from GPU?
|
||||||
[ ] Figure out a way to vectorize the simple edge
|
[ ] Figure out a way to vectorize the simple edge
|
||||||
|
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|||||||
90
notes/layout-scripts.txt
Normal file
90
notes/layout-scripts.txt
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
Content-Type: text/x-zim-wiki
|
||||||
|
Wiki-Format: zim 0.4
|
||||||
|
Creation-Date: 2020-10-06T22:33:37-07:00
|
||||||
|
|
||||||
|
====== layout-scripts ======
|
||||||
|
Created Tuesday 06 October 2020
|
||||||
|
|
||||||
|
===== Keywords =====
|
||||||
|
|
||||||
|
***table will need some description of it's requested elements***
|
||||||
|
**Actually I think this could just be done in the parser. Emitting warnings if names dont match**
|
||||||
|
|
||||||
|
elem table {
|
||||||
|
}
|
||||||
|
|
||||||
|
**elem is a keyword specifying that the next token will implement some type of rendering behaviour in this case, it is a table.**
|
||||||
|
|
||||||
|
elem table : globalTableFormatting {
|
||||||
|
meta tableFormatting {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
meta globalTableFormatting : {
|
||||||
|
}
|
||||||
|
|
||||||
|
**meta is a keyword specifying that the next token will contain some subset of the data that an elem that needs to render.**
|
||||||
|
|
||||||
|
|
||||||
|
===== Nesting =====
|
||||||
|
|
||||||
|
**There is no way around a tree structure in the markup.**
|
||||||
|
|
||||||
|
elem table {
|
||||||
|
meta tableFormatting {
|
||||||
|
color: Black,
|
||||||
|
}
|
||||||
|
elem tr {
|
||||||
|
elem tc {
|
||||||
|
text: "testText1"
|
||||||
|
}
|
||||||
|
elem tc {
|
||||||
|
text: "testText2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
**But I think I can strongly type the nesting structure, e.g**
|
||||||
|
|
||||||
|
struct Table {
|
||||||
|
fn addChild(child: TableRow)
|
||||||
|
}
|
||||||
|
elem!(table, Table)
|
||||||
|
|
||||||
|
struct TableRow {
|
||||||
|
fn addChild(child: TableColumn)
|
||||||
|
}
|
||||||
|
elem!(table, TableRow)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -26,7 +26,6 @@ pub struct EventSystem;
|
|||||||
impl<'a> System<'a> for EventSystem {
|
impl<'a> System<'a> for EventSystem {
|
||||||
type SystemData = (
|
type SystemData = (
|
||||||
Entities<'a>,
|
Entities<'a>,
|
||||||
WriteStorage<'a, Position>,
|
|
||||||
WriteStorage<'a, Evented>,
|
WriteStorage<'a, Evented>,
|
||||||
Write<'a, PersistentState>,
|
Write<'a, PersistentState>,
|
||||||
Write<'a, VkProcessor>,
|
Write<'a, VkProcessor>,
|
||||||
@@ -35,21 +34,19 @@ impl<'a> System<'a> for EventSystem {
|
|||||||
|
|
||||||
fn run(&mut self, (
|
fn run(&mut self, (
|
||||||
entity,
|
entity,
|
||||||
mut position_list,
|
|
||||||
mut evented_list,
|
mut evented_list,
|
||||||
mut state,
|
mut state,
|
||||||
mut vk_processor,
|
mut vk_processor,
|
||||||
event_stack
|
event_stack
|
||||||
): Self::SystemData) {
|
): Self::SystemData) {
|
||||||
|
|
||||||
for (position, evented) in (&mut position_list, &evented_list).join() {
|
for (evented) in (&evented_list).join() {
|
||||||
for event in &*event_stack {
|
for event in &*event_stack {
|
||||||
match event {
|
match event {
|
||||||
TrEvent::WindowEvent { window_id, event } => {
|
TrEvent::WindowEvent { window_id, event } => {
|
||||||
match event {
|
match event {
|
||||||
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
|
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
|
||||||
if *state == ElementState::Pressed {
|
if *state == ElementState::Pressed {
|
||||||
position.x += 100.0;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|||||||
33
src/main.rs
33
src/main.rs
@@ -47,6 +47,8 @@ use crate::util::vertex::{TextureVertex3D, VertexTypeContainer};
|
|||||||
use crate::vkprocessor::VkProcessor;
|
use crate::vkprocessor::VkProcessor;
|
||||||
use crate::compu_system::{CompuSystem, Compu};
|
use crate::compu_system::{CompuSystem, Compu};
|
||||||
use crate::event_system::{EventSystem, Evented};
|
use crate::event_system::{EventSystem, Evented};
|
||||||
|
use petgraph::Graph;
|
||||||
|
use petgraph::graph::NodeIndex;
|
||||||
|
|
||||||
pub mod util;
|
pub mod util;
|
||||||
pub mod vkprocessor;
|
pub mod vkprocessor;
|
||||||
@@ -146,6 +148,36 @@ pub fn main() {
|
|||||||
compu_frame: CompuFrame::new((0, 0)),
|
compu_frame: CompuFrame::new((0, 0)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
let mut g = Graph::new();
|
||||||
|
let mut matrix : Vec<Vec<NodeIndex<u32>>> = vec![vec![NodeIndex::new(1); 20]; 20];
|
||||||
|
|
||||||
|
for x in 0..20 {
|
||||||
|
for y in 0..20 {
|
||||||
|
matrix[x][y] = g.add_node(((x, y), 0.));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for x in 0..20 {
|
||||||
|
for y in 0..20 {
|
||||||
|
|
||||||
|
|
||||||
|
matrix[x][y] = g.add_node(((x, y), 0.));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
g.extend_with_edges(&[
|
||||||
|
(a, b, 1),
|
||||||
|
(a, d, 1),
|
||||||
|
(b, c, 1),
|
||||||
|
(b, f, 1),
|
||||||
|
(c, e, 1),
|
||||||
|
(e, f, 1),
|
||||||
|
(d, e, 1),
|
||||||
|
]);*/
|
||||||
|
|
||||||
// and the thing that renders it
|
// and the thing that renders it
|
||||||
world.create_entity()
|
world.create_entity()
|
||||||
.with(Compu { kernels: vec![compute_kernel], buffers: vec![compute_buffer] })// just a drawable
|
.with(Compu { kernels: vec![compute_kernel], buffers: vec![compute_buffer] })// just a drawable
|
||||||
@@ -244,7 +276,6 @@ pub fn main() {
|
|||||||
}
|
}
|
||||||
accumulator_time += delta_time;
|
accumulator_time += delta_time;
|
||||||
|
|
||||||
world.
|
|
||||||
|
|
||||||
// This dispatches all the systems in parallel (but blocking).
|
// This dispatches all the systems in parallel (but blocking).
|
||||||
world.write_resource::<PersistentState>()
|
world.write_resource::<PersistentState>()
|
||||||
|
|||||||
Reference in New Issue
Block a user