diff --git a/Cargo.toml b/Cargo.toml index 3fa6631..99cdea0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,3 @@ [workspace] resolver = "2" -members = ["hui", "hui-derive", "hui-examples", "hui-glium", "hui-wgpu", "hui-winit"] +members = ["hui", "hui-derive", "hui-examples", "hui-glium", "hui-painter", "hui-shared", "hui-wgpu", "hui-winit"] diff --git a/README.md b/README.md index f383f8d..a6a0b78 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,11 @@ hui-glium = <master>
- glium = "0.34" + glium = "0.35" hui-winit = <master>
- winit = "0.30" or winit = "0.29" + winit = "0.30" hui-wgpu = <master>
diff --git a/hui-examples/Cargo.toml b/hui-examples/Cargo.toml index fc7dcd0..9a30f18 100644 --- a/hui-examples/Cargo.toml +++ b/hui-examples/Cargo.toml @@ -8,11 +8,11 @@ publish = false [dev-dependencies] hui = { path = "../hui" } hui-glium = { path = "../hui-glium" } -hui-winit = { path = "../hui-winit", features = ["winit_29"] } +hui-winit = { path = "../hui-winit" } kubi-logging = { git = "https://github.com/griffi-gh/kubi", rev = "c162893fd" } -glium = "0.34" -winit = "0.29" -glam = "0.27" +glium = "0.35" +winit = "0.30" +glam = "0.28" log = "0.4" image = { version = "0.25", features = ["jpeg", "png"] } diff --git a/hui-glium/Cargo.toml b/hui-glium/Cargo.toml index 9448d2b..13dae9c 100644 --- a/hui-glium/Cargo.toml +++ b/hui-glium/Cargo.toml @@ -17,6 +17,6 @@ include = [ [dependencies] hui = { version = "=0.1.0-alpha.5", path = "../hui", default-features = false } -glium = { version = "0.34", default-features = false } -glam = "0.27" +glium = { version = "0.35", default-features = false } +glam = "0.28" log = "0.4" diff --git a/hui-painter/Cargo.toml b/hui-painter/Cargo.toml new file mode 100644 index 0000000..4e651a8 --- /dev/null +++ b/hui-painter/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "hui-painter" +description = "UI rendering middleware for hUI, abstracts away triangulation, text rendering and all the other hard stuff." +repository = "https://github.com/griffi-gh/hui" +readme = "../README.md" +authors = ["griffi-gh "] +rust-version = "1.75" +version = "0.1.0-alpha.5" +edition = "2021" +license = "GPL-3.0-or-later" +publish = true +include = [ + "assets/**/*", + "src/**/*.rs", + "Cargo.toml", +] + +[dependencies] +hui-shared = { version = "0.1.0-alpha.5", path = "../hui-shared" } +glam = "0.28" diff --git a/hui-painter/src/lib.rs b/hui-painter/src/lib.rs new file mode 100644 index 0000000..da84108 --- /dev/null +++ b/hui-painter/src/lib.rs @@ -0,0 +1,17 @@ +//TODO painter rewrite + +mod rect; +pub use rect::PaintRectParams; + +pub struct PaintTransformParams { + transform: glam::Affine2, +} + +pub enum PaintCommand { + Rect(PaintRectParams), + Transform(PaintTransformParams, Box), +} + +pub struct Painter { + +} diff --git a/hui-painter/src/rect.rs b/hui-painter/src/rect.rs new file mode 100644 index 0000000..c54048d --- /dev/null +++ b/hui-painter/src/rect.rs @@ -0,0 +1,19 @@ +use glam::Vec2; +use hui_shared::rect::{Corners, FillColor}; + +pub struct PaintRectParams { + /// Position of the top-left corner of the rectangle. + pub position: Vec2, + + /// Position of the bottom-right corner of the rectangle. + pub size: Vec2, + + /// Color of the rectangle. + pub color: FillColor, + + /// Border width. + pub border_radius: Corners, + + /// Border color. + pub border_radius_points_override: Option, +} diff --git a/hui-shared/Cargo.toml b/hui-shared/Cargo.toml new file mode 100644 index 0000000..8896e63 --- /dev/null +++ b/hui-shared/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "hui-shared" +version = "0.1.0-alpha.5" +edition = "2021" + +[dependencies] +glam = "0.28" diff --git a/hui-shared/src/lib.rs b/hui-shared/src/lib.rs new file mode 100644 index 0000000..2330a35 --- /dev/null +++ b/hui-shared/src/lib.rs @@ -0,0 +1 @@ +pub mod rect; diff --git a/hui/src/rect.rs b/hui-shared/src/rect.rs similarity index 100% rename from hui/src/rect.rs rename to hui-shared/src/rect.rs diff --git a/hui/src/rect/color.rs b/hui-shared/src/rect/color.rs similarity index 100% rename from hui/src/rect/color.rs rename to hui-shared/src/rect/color.rs diff --git a/hui/src/rect/corners.rs b/hui-shared/src/rect/corners.rs similarity index 100% rename from hui/src/rect/corners.rs rename to hui-shared/src/rect/corners.rs diff --git a/hui/src/rect/rect.rs b/hui-shared/src/rect/rect.rs similarity index 100% rename from hui/src/rect/rect.rs rename to hui-shared/src/rect/rect.rs diff --git a/hui/src/rect/sides.rs b/hui-shared/src/rect/sides.rs similarity index 100% rename from hui/src/rect/sides.rs rename to hui-shared/src/rect/sides.rs diff --git a/hui-wgpu/Cargo.toml b/hui-wgpu/Cargo.toml index ac85675..4eb95eb 100644 --- a/hui-wgpu/Cargo.toml +++ b/hui-wgpu/Cargo.toml @@ -20,4 +20,4 @@ hui = { version = "=0.1.0-alpha.5", path = "../hui", default-features = false } wgpu = { version = "0.20", default-features = false, features = ["wgsl"]} bytemuck = "1.15" log = "0.4" -glam = "0.27" +glam = "0.28" diff --git a/hui-winit/Cargo.toml b/hui-winit/Cargo.toml index 00c622d..8354f6f 100644 --- a/hui-winit/Cargo.toml +++ b/hui-winit/Cargo.toml @@ -15,12 +15,13 @@ include = [ [dependencies] hui = { version = "=0.1.0-alpha.5", path = "../hui", default-features = false } -winit_30 = { package = "winit", version = "0.30", default-features = false, optional = true } -winit_29 = { package = "winit", version = "0.29", default-features = false, optional = true } -glam = "0.27" +winit = { version = "0.30", default-features = false } +# winit_30 = { package = "winit", version = "0.30", default-features = false, optional = true } +# winit_29 = { package = "winit", version = "0.29", default-features = false, optional = true } +glam = "0.28" log = "0.4" [features] default = [] -winit_30 = ["dep:winit_30"] -winit_29 = ["dep:winit_29"] +# winit_30 = ["dep:winit_30"] +# winit_29 = ["dep:winit_29"] diff --git a/hui-winit/src/lib.rs b/hui-winit/src/lib.rs index 5dec0f9..43dae5c 100644 --- a/hui-winit/src/lib.rs +++ b/hui-winit/src/lib.rs @@ -1,9 +1,9 @@ -#[cfg(all(feature = "winit_30", feature = "winit_29"))] -compile_error!("Only one of the winit_30 and winit_29 features can be enabled at a time"); -#[cfg(not(any(feature = "winit_30", feature = "winit_29")))] -compile_error!("One of the winit_30 and winit_29 features must be enabled"); -#[cfg(feature = "winit_30")] extern crate winit_30 as winit; -#[cfg(feature = "winit_29")] extern crate winit_29 as winit; +// #[cfg(all(feature = "winit_30", feature = "winit_29"))] +// compile_error!("Only one of the winit_30 and winit_29 features can be enabled at a time"); +// #[cfg(not(any(feature = "winit_30", feature = "winit_29")))] +// compile_error!("One of the winit_30 and winit_29 features must be enabled"); +// #[cfg(feature = "winit_30")] extern crate winit_30 as winit; +// #[cfg(feature = "winit_29")] extern crate winit_29 as winit; use glam::vec2; use hui::{event::UiEvent, UiInstance}; diff --git a/hui/Cargo.toml b/hui/Cargo.toml index 1ecd3ca..d641899 100644 --- a/hui/Cargo.toml +++ b/hui/Cargo.toml @@ -17,10 +17,12 @@ include = [ [dependencies] hui-derive = { version = "0.1.0-alpha.5", path = "../hui-derive", optional = true } +hui-shared = { version = "0.1.0-alpha.5", path = "../hui-shared" } +hui-painter = { version = "0.1.0-alpha.5", path = "../hui-painter" } hashbrown = "0.14" nohash-hasher = "0.2" -glam = "0.27" -fontdue = "0.8" +glam = "0.28.0" +fontdue = "0.9" rect_packer = "0.2" log = "0.4" document-features = "0.2" @@ -28,7 +30,7 @@ derive_setters = "0.1" derive_more = "0.99" tinyset = "0.4" image = { version = "0.25", default-features = false, optional = true } -rustc-hash = "1.1" +rustc-hash = "2.0" [features] default = ["el_all", "image", "builtin_font", "pixel_perfect_text", "derive"] diff --git a/hui/src/lib.rs b/hui/src/lib.rs index 1abf0e3..212dc8f 100644 --- a/hui/src/lib.rs +++ b/hui/src/lib.rs @@ -11,10 +11,11 @@ #![forbid(unsafe_op_in_unsafe_fn)] #![allow(unused_parens)] +pub use hui_shared::*; + mod instance; mod macros; pub mod layout; -pub mod rect; pub mod element; pub mod event; pub mod input;