diff --git a/CHANGELOG.md b/CHANGELOG.md index 323e2be6..961767e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,14 @@ # Changelog All notable changes to this project will be documented in this file. -## v0.10.0 +## v0.11.0 - 18/10/2023 + +- Added traits `Serialize` and `Deserialize` to `Color` with the feature `serde` enabled. +- Updated EGUI to `0.23`. +- Fixed an error acquiring the GL Context due required samples configuration. + +## v0.10.0 - 11/09/2023 + - Added `WindowConfig::set_position` to set x/y position before creating the window. - Changed `Renderer.begin` uses `Option` instead of `Option<&ClearOption>`. - Changed sizes and positions for Window and Textures from `i32` to `u32`. diff --git a/Cargo.lock b/Cargo.lock index 7add8a31..66e7022e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,6 +18,16 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "accesskit" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76eb1adf08c5bcaa8490b9851fd53cca27fa9880076f178ea9d29f05196728a8" +dependencies = [ + "enumn", + "serde", +] + [[package]] name = "adler" version = "1.0.2" @@ -32,6 +42,7 @@ checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", "once_cell", + "serde", "version_check", ] @@ -134,12 +145,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "atomic_refcell" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112ef6b3f6cb3cb6fc5b6b494ef7a848492cff1ab0ef4de10b0f7d572861c905" - [[package]] name = "autocfg" version = "1.1.0" @@ -242,7 +247,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -569,9 +574,12 @@ checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f" [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "digest" @@ -605,47 +613,62 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "ecolor" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e479a7fa3f23d4e794f8b2f8b3568dd4e47886ad1b12c9c095e141cb591eb63" +checksum = "cfdf4e52dbbb615cfd30cf5a5265335c217b5fd8d669593cea74a517d9c605af" dependencies = [ "bytemuck", + "serde", ] [[package]] name = "egui" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aef8ec3ae1b772f340170c65bf27d5b8c28f543a0116c844d2ac08d01123e7" +checksum = "8bd69fed5fcf4fbb8225b24e80ea6193b61e17a625db105ef0c4d71dde6eb8b7" dependencies = [ + "accesskit", "ahash", "epaint", "nohash-hasher", + "serde", ] [[package]] name = "egui_demo_lib" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "807f2eaee012c4f10d541db010845340fcdebf0b97b82b88a13e5ca1d6c84385" +checksum = "157bdb4408d324d9035c1b5cc517c6c4f0b8067195a931402a282c464f366cd7" dependencies = [ "egui", "egui_extras", - "enum-map", + "egui_plot", "log", "unicode_names2", ] [[package]] name = "egui_extras" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9278f4337b526f0d57e5375e5a7340a311fa6ee8f9fcc75721ac50af13face02" +checksum = "68ffe3fe5c00295f91c2a61a74ee271c32f74049c94ba0b1cea8f26eb478bc07" dependencies = [ "egui", + "enum-map", + "log", + "mime_guess", "serde", ] +[[package]] +name = "egui_plot" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f33a00fe8eb1ba56535b3dbacdecc7a1365a328908a97c5f3c81bb466be72b" +dependencies = [ + "egui", +] + [[package]] name = "either" version = "1.9.0" @@ -654,11 +677,12 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3857d743a6e0741cdd60b622a74c7a36ea75f5f8f11b793b41d905d2c9721a4b" +checksum = "1ef2b29de53074e575c18b694167ccbe6e5191f7b25fe65175a0d905a32eeec0" dependencies = [ "bytemuck", + "serde", ] [[package]] @@ -688,23 +712,34 @@ checksum = "ccb14d927583dd5c2eac0f2cf264fc4762aefe1ae14c47a8a20fc1939d3a5fc0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", +] + +[[package]] +name = "enumn" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.38", ] [[package]] name = "epaint" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09333964d4d57f40a85338ba3ca5ed4716070ab184dcfed966b35491c5c64f3b" +checksum = "58067b840d009143934d91d8dcb8ded054d8301d7c11a517ace0a99bb1e1595e" dependencies = [ "ab_glyph", "ahash", - "atomic_refcell", "bytemuck", "ecolor", "emath", "nohash-hasher", "parking_lot", + "serde", ] [[package]] @@ -883,7 +918,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -961,9 +996,9 @@ dependencies = [ [[package]] name = "glam" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" +checksum = "b5418c17512bdf42730f9032c74e1ae39afc408745ebb2acf72fbc4691c17945" dependencies = [ "bytemuck", "mint", @@ -1065,9 +1100,9 @@ dependencies = [ [[package]] name = "glyph_brush" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edefd123f28a0b1d41ec4a489c2b43020b369180800977801611084f342978d" +checksum = "a3676f482c536a985fca36ce320a5e5b8fafd7b260806742af1963b71c5dc38c" dependencies = [ "glyph_brush_draw_cache", "glyph_brush_layout", @@ -1103,15 +1138,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" dependencies = [ "ahash", "allocator-api2", @@ -1160,22 +1189,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown", ] [[package]] @@ -1584,7 +1603,7 @@ dependencies = [ [[package]] name = "notan" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "egui_demo_lib", @@ -1608,14 +1627,14 @@ dependencies = [ [[package]] name = "notan_app" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "downcast-rs", "futures", "futures-util", - "hashbrown 0.14.0", - "indexmap 1.9.3", + "hashbrown", + "indexmap", "js-sys", "log", "notan_audio", @@ -1634,14 +1653,14 @@ dependencies = [ [[package]] name = "notan_audio" -version = "0.10.0" +version = "0.11.0" dependencies = [ "parking_lot", ] [[package]] name = "notan_backend" -version = "0.10.0" +version = "0.11.0" dependencies = [ "notan_web", "notan_winit", @@ -1649,7 +1668,7 @@ dependencies = [ [[package]] name = "notan_core" -version = "0.10.0" +version = "0.11.0" dependencies = [ "serde", "web-sys", @@ -1657,7 +1676,7 @@ dependencies = [ [[package]] name = "notan_draw" -version = "0.10.0" +version = "0.11.0" dependencies = [ "log", "lyon", @@ -1673,7 +1692,7 @@ dependencies = [ [[package]] name = "notan_egui" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "egui", @@ -1685,7 +1704,7 @@ dependencies = [ [[package]] name = "notan_extra" -version = "0.10.0" +version = "0.11.0" dependencies = [ "notan_app", "spin_sleep", @@ -1693,11 +1712,11 @@ dependencies = [ [[package]] name = "notan_glow" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "glow", - "hashbrown 0.14.0", + "hashbrown", "image", "js-sys", "log", @@ -1708,7 +1727,7 @@ dependencies = [ [[package]] name = "notan_glyph" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "glyph_brush", @@ -1721,7 +1740,7 @@ dependencies = [ [[package]] name = "notan_graphics" -version = "0.10.0" +version = "0.11.0" dependencies = [ "bytemuck", "crevice_notan", @@ -1730,13 +1749,14 @@ dependencies = [ "notan_math", "notan_utils", "parking_lot", + "serde", ] [[package]] name = "notan_input" -version = "0.10.0" +version = "0.11.0" dependencies = [ - "hashbrown 0.14.0", + "hashbrown", "log", "notan_core", "notan_math", @@ -1745,7 +1765,7 @@ dependencies = [ [[package]] name = "notan_log" -version = "0.10.0" +version = "0.11.0" dependencies = [ "console_log", "fern", @@ -1758,7 +1778,7 @@ dependencies = [ [[package]] name = "notan_macro" -version = "0.10.0" +version = "0.11.0" dependencies = [ "cfg_aliases", "glsl-to-spirv", @@ -1767,12 +1787,12 @@ dependencies = [ "quote", "shaderc", "spirv_cross", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "notan_math" -version = "0.10.0" +version = "0.11.0" dependencies = [ "glam", "serde", @@ -1780,10 +1800,10 @@ dependencies = [ [[package]] name = "notan_oddio" -version = "0.10.0" +version = "0.11.0" dependencies = [ "cpal", - "hashbrown 0.14.0", + "hashbrown", "log", "notan_audio", "oddio", @@ -1792,7 +1812,7 @@ dependencies = [ [[package]] name = "notan_random" -version = "0.10.0" +version = "0.11.0" dependencies = [ "getrandom", "rand", @@ -1801,9 +1821,9 @@ dependencies = [ [[package]] name = "notan_text" -version = "0.10.0" +version = "0.11.0" dependencies = [ - "hashbrown 0.14.0", + "hashbrown", "lazy_static", "log", "notan_app", @@ -1815,7 +1835,7 @@ dependencies = [ [[package]] name = "notan_utils" -version = "0.10.0" +version = "0.11.0" dependencies = [ "instant", "js-sys", @@ -1827,7 +1847,7 @@ dependencies = [ [[package]] name = "notan_web" -version = "0.10.0" +version = "0.11.0" dependencies = [ "console_error_panic_hook", "futures-util", @@ -1846,7 +1866,7 @@ dependencies = [ [[package]] name = "notan_winit" -version = "0.10.0" +version = "0.11.0" dependencies = [ "arboard", "glutin", @@ -2002,7 +2022,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] @@ -2118,9 +2138,9 @@ dependencies = [ [[package]] name = "ordered-float" -version = "3.9.1" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a54938017eacd63036332b4ae5c8a49fc8c0c1d6d629893057e4f13609edd06" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" dependencies = [ "num-traits", ] @@ -2212,6 +2232,12 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2230,9 +2256,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2436,14 +2462,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -2736,9 +2762,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2775,19 +2801,20 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", ] [[package]] name = "time" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -2795,15 +2822,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -2860,7 +2887,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap", "toml_datetime", "winnow", ] @@ -2984,7 +3011,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -3018,7 +3045,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3126,9 +3153,9 @@ dependencies = [ [[package]] name = "webbrowser" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2c79b77f525a2d670cb40619d7d9c673d09e0666f72c591ebd7861f84a87e57" +checksum = "82b2391658b02c27719fc5a0a73d6e696285138e8b12fba9d4baa70451023c71" dependencies = [ "core-foundation", "home", diff --git a/Cargo.toml b/Cargo.toml index 7511196b..a84ed336 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,54 +1,56 @@ [package] name = "notan" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true categories = ["graphics", "rendering", "wasm", "gui", "multimedia"] keywords = ["notan", "engine", "gamedev", "gui", "windowing"] exclude = ["docs/**/*", "scripts/**/*", "crates/**/*"] readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "A simple portable multimedia layer to create apps or games easily" -[package.metadata.docs.rs] -features = ["default", "glyph", "egui", "text", "extra", "audio", "links", "drop_files", "clipboard", "save_file", "texture_to_file"] - -[profile.release] -lto = true - [workspace] members = ["crates/*"] +[workspace.package] +version = "0.11.0" +authors = ["Nazarí González "] +license = "MIT OR Apache-2.0" +homepage = "https://github.com/Nazariglez/notan" +repository = "https://github.com/Nazariglez/notan" +edition = "2021" + [workspace.dependencies] -notan_core = { path = "crates/notan_core", version = "0.10.0" } -notan_input = { path = "crates/notan_input", version = "0.10.0" } -notan_app = { path = "crates/notan_app", version = "0.10.0" } -notan_macro = { path = "crates/notan_macro", version = "0.10.0" } -notan_math = { path = "crates/notan_math", version = "0.10.0" } -notan_graphics = { path = "crates/notan_graphics", version = "0.10.0" } -notan_utils = { path = "crates/notan_utils", version = "0.10.0" } -notan_log = { path = "crates/notan_log", version = "0.10.0" } -notan_glyph = { path = "crates/notan_glyph", version = "0.10.0" } -notan_draw = { path = "crates/notan_draw", version = "0.10.0" } -notan_backend = { path = "crates/notan_backend", version = "0.10.0" } -notan_egui = { path = "crates/notan_egui", version = "0.10.0" } -notan_text = { path = "crates/notan_text", version = "0.10.0" } -notan_audio = { path = "crates/notan_audio", version = "0.10.0" } -notan_extra = { path = "crates/notan_extra", version = "0.10.0" } -notan_random = { path = "crates/notan_random", version = "0.10.0" } -notan_winit = { path = "crates/notan_winit", version = "0.10.0" } -notan_web = { path = "crates/notan_web", version = "0.10.0" } -notan_glow = { path = "crates/notan_glow", version = "0.10.0" } -notan_oddio = { path = "crates/notan_oddio", version = "0.10.0" } +notan_core = { path = "crates/notan_core", version = "0.11.0" } +notan_input = { path = "crates/notan_input", version = "0.11.0" } +notan_app = { path = "crates/notan_app", version = "0.11.0" } +notan_macro = { path = "crates/notan_macro", version = "0.11.0" } +notan_math = { path = "crates/notan_math", version = "0.11.0" } +notan_graphics = { path = "crates/notan_graphics", version = "0.11.0" } +notan_utils = { path = "crates/notan_utils", version = "0.11.0" } +notan_log = { path = "crates/notan_log", version = "0.11.0" } +notan_glyph = { path = "crates/notan_glyph", version = "0.11.0" } +notan_draw = { path = "crates/notan_draw", version = "0.11.0" } +notan_backend = { path = "crates/notan_backend", version = "0.11.0" } +notan_egui = { path = "crates/notan_egui", version = "0.11.0" } +notan_text = { path = "crates/notan_text", version = "0.11.0" } +notan_audio = { path = "crates/notan_audio", version = "0.11.0" } +notan_extra = { path = "crates/notan_extra", version = "0.11.0" } +notan_random = { path = "crates/notan_random", version = "0.11.0" } +notan_winit = { path = "crates/notan_winit", version = "0.11.0" } +notan_web = { path = "crates/notan_web", version = "0.11.0" } +notan_glow = { path = "crates/notan_glow", version = "0.11.0" } +notan_oddio = { path = "crates/notan_oddio", version = "0.11.0" } log = "0.4.20" -hashbrown = "0.14.0" +hashbrown = "0.14.1" parking_lot = "0.12.1" -bytemuck = "1.13.1" +bytemuck = "1.14.0" serde = { version = "1.0", features = ["serde_derive"] } -image = { version = "0.24.6", default-features = false, features = ["jpeg", "png", "ico"] } +image = { version = "0.24.7", default-features = false, features = ["jpeg", "png", "ico"] } # wasm deps wasm-bindgen = "0.2.87" @@ -93,10 +95,16 @@ texture_to_file = ["notan_graphics/texture_to_file"] random = ["notan_random"] glsl-to-spirv = ["notan_macro/glsl-to-spirv", "notan_glyph?/glsl-to-spirv", "notan_draw?/glsl-to-spirv", "notan_egui?/glsl-to-spirv", "notan_text?/glsl-to-spirv"] shaderc = ["notan_macro/shaderc", "notan_glyph?/shaderc", "notan_draw?/shaderc", "notan_egui?/shaderc", "notan_text?/shaderc"] -serde = ["notan_app/serde", "notan_math/serde", "notan_core/serde", "notan_input/serde"] +serde = ["notan_app/serde", "notan_math/serde", "notan_core/serde", "notan_input/serde", "notan_graphics/serde"] + +[package.metadata.docs.rs] +features = ["default", "glyph", "egui", "text", "extra", "audio", "links", "drop_files", "clipboard", "save_file", "texture_to_file"] + +[profile.release] +lto = true [dev-dependencies] -egui_demo_lib = "0.22.0" +egui_demo_lib = "0.23.0" bytemuck = "1.14.0" [[example]] diff --git a/crates/notan_app/Cargo.toml b/crates/notan_app/Cargo.toml index b269e54f..7fc25dcf 100644 --- a/crates/notan_app/Cargo.toml +++ b/crates/notan_app/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_app" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides the core API for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -27,7 +27,7 @@ bytemuck.workspace = true serde = { workspace = true, optional = true } downcast-rs = "1.2.0" -indexmap = "1.9.3" +indexmap = "2.0.2" futures = "0.3.28" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/notan_audio/Cargo.toml b/crates/notan_audio/Cargo.toml index 42885951..0a6bb68a 100644 --- a/crates/notan_audio/Cargo.toml +++ b/crates/notan_audio/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_audio" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides simple audio API for Notan" [dependencies] diff --git a/crates/notan_backend/Cargo.toml b/crates/notan_backend/Cargo.toml index ac1b5a0c..30cb7b62 100644 --- a/crates/notan_backend/Cargo.toml +++ b/crates/notan_backend/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_backend" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a default backend for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/notan_core/Cargo.toml b/crates/notan_core/Cargo.toml index 1633cf51..d0a0044c 100644 --- a/crates/notan_core/Cargo.toml +++ b/crates/notan_core/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_core" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Basic types and structs used in Notan" [dependencies] diff --git a/crates/notan_draw/Cargo.toml b/crates/notan_draw/Cargo.toml index e9f68c3a..fb12c65c 100644 --- a/crates/notan_draw/Cargo.toml +++ b/crates/notan_draw/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_draw" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a simple 2D API for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -22,7 +22,7 @@ notan_text.workspace = true serde = { workspace = true, features = ["derive"] } lyon = "1.0.1" -serde_json = "1.0.96" +serde_json = "1.0.107" [features] glsl-to-spirv = ["notan_macro/glsl-to-spirv", "notan_glyph/glsl-to-spirv", "notan_text/glsl-to-spirv"] diff --git a/crates/notan_egui/Cargo.toml b/crates/notan_egui/Cargo.toml index 75a775bb..62cb2872 100644 --- a/crates/notan_egui/Cargo.toml +++ b/crates/notan_egui/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_egui" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides EGUI support for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,7 +19,7 @@ notan_macro.workspace = true log.workspace = true bytemuck.workspace = true -egui = { version = "0.22.0", features = ["bytemuck"] } +egui = { version = "0.23.0", features = ["bytemuck"] } [features] links = [] diff --git a/crates/notan_egui/src/extension.rs b/crates/notan_egui/src/extension.rs index 54af681f..8c1125e8 100644 --- a/crates/notan_egui/src/extension.rs +++ b/crates/notan_egui/src/extension.rs @@ -3,6 +3,7 @@ use crate::epaint::Primitive; use crate::plugin::Output; use crate::TextureId; +use egui::load::SizedTexture; use egui::{PaintCallbackInfo, Rect}; use notan_app::{ BlendFactor, BlendMode, Buffer, CullMode, Device, Graphics, Pipeline, RenderTexture, @@ -149,14 +150,15 @@ impl EguiExtension { }) } - pub fn add_texture(&mut self, texture: &Texture) -> egui::TextureId { + pub fn add_texture(&mut self, texture: &Texture) -> SizedTexture { let id = egui::TextureId::User(texture.id()); + let size: egui::Vec2 = texture.size().into(); self.textures.insert(id, texture.clone()); - id + SizedTexture { id, size } } - pub fn remove_texture(&mut self, id: egui::TextureId) { - self.free_texture(id); + pub fn remove_texture(&mut self, id: impl Into) { + self.free_texture(id.into()); } fn set_texture( @@ -388,18 +390,18 @@ impl EguiExtension { } pub trait EguiRegisterTexture { - fn egui_register_texture(&mut self, texture: &Texture) -> egui::TextureId; - fn egui_remove_texture(&mut self, id: egui::TextureId); + fn egui_register_texture(&mut self, texture: &Texture) -> egui::load::SizedTexture; + fn egui_remove_texture(&mut self, id: impl Into); } impl EguiRegisterTexture for Graphics { - fn egui_register_texture(&mut self, texture: &Texture) -> TextureId { + fn egui_register_texture(&mut self, texture: &Texture) -> SizedTexture { self.extension_mut::() .unwrap() .add_texture(texture) } - fn egui_remove_texture(&mut self, id: TextureId) { + fn egui_remove_texture(&mut self, id: impl Into) { self.extension_mut::() .unwrap() .remove_texture(id); diff --git a/crates/notan_egui/src/lib.rs b/crates/notan_egui/src/lib.rs index 92ad0c1c..cba26831 100644 --- a/crates/notan_egui/src/lib.rs +++ b/crates/notan_egui/src/lib.rs @@ -7,4 +7,5 @@ pub use config::EguiConfig; pub use extension::{EguiCallbackFn, EguiExtension, EguiRegisterTexture}; pub use plugin::{EguiPlugin, EguiPluginSugar}; +pub use egui::load::SizedTexture; pub use egui::*; diff --git a/crates/notan_egui/src/plugin.rs b/crates/notan_egui/src/plugin.rs index 777552ff..ba9a5255 100644 --- a/crates/notan_egui/src/plugin.rs +++ b/crates/notan_egui/src/plugin.rs @@ -255,14 +255,14 @@ impl Plugin for EguiPlugin { id: egui::TouchId(*id), phase: egui::TouchPhase::Start, pos: (*x, *y).into(), - force: 0.0, + force: Some(0.0), }), Event::TouchMove { id, x, y } => self.add_event(egui::Event::Touch { device_id: egui::TouchDeviceId(0), id: egui::TouchId(*id), phase: egui::TouchPhase::Move, pos: (*x, *y).into(), - force: 0.0, + force: Some(0.0), }), Event::TouchEnd { id, x, y } => { self.add_event(egui::Event::Touch { @@ -270,7 +270,7 @@ impl Plugin for EguiPlugin { id: egui::TouchId(*id), phase: egui::TouchPhase::End, pos: (*x, *y).into(), - force: 0.0, + force: Some(0.0), }); is_touch_end = true; @@ -281,7 +281,7 @@ impl Plugin for EguiPlugin { id: egui::TouchId(*id), phase: egui::TouchPhase::Cancel, pos: (*x, *y).into(), - force: 0.0, + force: Some(0.0), }); is_touch_end = true; } diff --git a/crates/notan_extra/Cargo.toml b/crates/notan_extra/Cargo.toml index 37ae86bd..db8dbaab 100644 --- a/crates/notan_extra/Cargo.toml +++ b/crates/notan_extra/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_extra" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides extra features or plugins for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/notan_glow/Cargo.toml b/crates/notan_glow/Cargo.toml index 10f435af..dbcea6f2 100644 --- a/crates/notan_glow/Cargo.toml +++ b/crates/notan_glow/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_glow" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides support for OpenGL, OpenGL ES and WebGL for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,7 +19,7 @@ bytemuck.workspace = true hashbrown.workspace = true image.workspace = true -glow = "0.12.1" +glow = "0.12.3" [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen.workspace = true diff --git a/crates/notan_glyph/Cargo.toml b/crates/notan_glyph/Cargo.toml index bf261c0d..49603cad 100644 --- a/crates/notan_glyph/Cargo.toml +++ b/crates/notan_glyph/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "notan_glyph" -version = "0.10.0" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides glyph's support for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,7 +20,7 @@ notan_macro.workspace = true log.workspace = true bytemuck.workspace = true -glyph_brush = "0.7.7" +glyph_brush = "0.7.8" [features] glsl-to-spirv = ["notan_macro/glsl-to-spirv"] diff --git a/crates/notan_graphics/Cargo.toml b/crates/notan_graphics/Cargo.toml index 91201d11..80e77587 100644 --- a/crates/notan_graphics/Cargo.toml +++ b/crates/notan_graphics/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_graphics" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides simple graphics API for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -21,6 +21,7 @@ parking_lot.workspace = true image = { workspace = true, optional = true } crevice_notan = { version = "0.13.0", features = ["glam"] } +serde = { workspace = true, optional = true } [features] texture_to_file = ["notan_utils/save_file", "image/png"] diff --git a/crates/notan_graphics/src/color.rs b/crates/notan_graphics/src/color.rs index 78ba5ea1..5ea62890 100644 --- a/crates/notan_graphics/src/color.rs +++ b/crates/notan_graphics/src/color.rs @@ -1,5 +1,6 @@ /// Represents a visual color #[derive(Debug, Clone, Copy, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Color { /// Red value pub r: f32, diff --git a/crates/notan_input/Cargo.toml b/crates/notan_input/Cargo.toml index fc781d89..2c84c293 100644 --- a/crates/notan_input/Cargo.toml +++ b/crates/notan_input/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_input" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a set of API to manage user's input" [dependencies] diff --git a/crates/notan_log/Cargo.toml b/crates/notan_log/Cargo.toml index 6a34e07a..70d33d86 100644 --- a/crates/notan_log/Cargo.toml +++ b/crates/notan_log/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_log" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a multipatform log support for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,7 +19,7 @@ log.workspace = true fern = { version = "0.6.2", features = ["colored"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -time = { version = "0.3.21", features = ["formatting", "local-offset"] } +time = { version = "0.3.30", features = ["formatting", "local-offset"] } [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen.workspace = true diff --git a/crates/notan_macro/Cargo.toml b/crates/notan_macro/Cargo.toml index 11c1d4ba..3ef35f00 100644 --- a/crates/notan_macro/Cargo.toml +++ b/crates/notan_macro/Cargo.toml @@ -1,23 +1,23 @@ [package] name = "notan_macro" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a set of utils as macros for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -syn = { version = "2.0.17", features = ["full", "extra-traits"] } -quote = "1.0.28" -num = "0.4.0" +syn = { version = "2.0.38", features = ["full", "extra-traits"] } +quote = "1.0.33" +num = "0.4.1" glsl-to-spirv = { version = "0.1.7", optional = true } shaderc = { version = "0.8.2", optional = true } -proc-macro2 = "1.0.59" +proc-macro2 = "1.0.69" spirv_cross = { version = "0.23.1", features = ["glsl"] } [build-dependencies] diff --git a/crates/notan_macro/src/handlers.rs b/crates/notan_macro/src/handlers.rs index ed55051e..7f6cca43 100644 --- a/crates/notan_macro/src/handlers.rs +++ b/crates/notan_macro/src/handlers.rs @@ -124,7 +124,7 @@ fn enum_impl_generator(tokens: &Tokens, once: bool) -> String { .ret .as_ref() .map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()); + .unwrap_or_default(); let callback = enum_callback_generics(&combo(&tokens.params), &tokens.params); let reference = if once { "" } else { "&" }; @@ -171,7 +171,7 @@ fn trait_impl_generator(tokens: &Tokens, gen_type: GenericType, fn_literal: &str .ret .as_ref() .map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()); + .unwrap_or_default(); let s_type = match gen_type { GenericType::Plugin => "Plugin + 'static", @@ -252,8 +252,7 @@ fn enum_generics(g: &[Vec], r: Option<&String>, fn_literal: &str) -> Str "_{}(Box)", i, gen, - r.map(|v| format!(" -> {v}")) - .unwrap_or_else(|| "".to_string()) + r.map(|v| format!(" -> {v}")).unwrap_or_default() ) }) .collect::>() diff --git a/crates/notan_math/Cargo.toml b/crates/notan_math/Cargo.toml index 3b77ed50..30ce6511 100644 --- a/crates/notan_math/Cargo.toml +++ b/crates/notan_math/Cargo.toml @@ -1,18 +1,18 @@ [package] name = "notan_math" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides simple set of math's utils for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -glam = { version = "0.24.0", features = ["bytemuck"] } +glam = { version = "0.24.2", features = ["bytemuck"] } serde = { workspace = true, optional = true } [features] diff --git a/crates/notan_oddio/Cargo.toml b/crates/notan_oddio/Cargo.toml index 4d056741..00e6cc73 100644 --- a/crates/notan_oddio/Cargo.toml +++ b/crates/notan_oddio/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "notan_oddio" -version = "0.10.0" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides support for Audio features using Oddio" [dependencies] @@ -16,4 +17,4 @@ hashbrown.workspace = true cpal = { version = "0.15.2", features = ["wasm-bindgen"] } oddio = "0.6.2" -symphonia = { version = "0.5.2", features = ["mp3"] } +symphonia = { version = "0.5.3", features = ["mp3"] } diff --git a/crates/notan_random/Cargo.toml b/crates/notan_random/Cargo.toml index e6d108a5..ad7ea396 100644 --- a/crates/notan_random/Cargo.toml +++ b/crates/notan_random/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_random" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a simple set of RNG utils for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,4 +16,4 @@ rand = "0.8.5" rand_pcg = "0.3.1" [target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2.9", features = ["js"] } +getrandom = { version = "0.2.10", features = ["js"] } diff --git a/crates/notan_text/Cargo.toml b/crates/notan_text/Cargo.toml index 2f3cef6f..0f3e7ef6 100644 --- a/crates/notan_text/Cargo.toml +++ b/crates/notan_text/Cargo.toml @@ -1,11 +1,12 @@ [package] name = "notan_text" -version = "0.10.0" -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a simple Text API for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/notan_utils/Cargo.toml b/crates/notan_utils/Cargo.toml index c81c0e21..ee421567 100644 --- a/crates/notan_utils/Cargo.toml +++ b/crates/notan_utils/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_utils" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a simple set of utils Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/notan_web/Cargo.toml b/crates/notan_web/Cargo.toml index 304d2201..3ddf76d9 100644 --- a/crates/notan_web/Cargo.toml +++ b/crates/notan_web/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_web" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a web/wasm32 backend for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/notan_winit/Cargo.toml b/crates/notan_winit/Cargo.toml index 640470c7..6583bc85 100644 --- a/crates/notan_winit/Cargo.toml +++ b/crates/notan_winit/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "notan_winit" -version = "0.10.0" -authors = ["Nazarí González "] -edition = "2021" +version.workspace = true +authors.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true readme = "README.md" -homepage = "https://github.com/Nazariglez/notan" -repository = "https://github.com/Nazariglez/notan" -license = "MIT OR Apache-2.0" description = "Provides a native backend using winit for Notan" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -22,12 +22,12 @@ notan_input = { workspace = true, optional = true } image.workspace = true log.workspace = true -glutin = "0.30.8" +glutin = "0.30.10" glutin-winit = "0.3.0" winit = "0.28.6" raw-window-handle = "0.5.2" -arboard = { version = "3.2.0", optional = true, default-features = false } -webbrowser = { version = "0.8.10", optional = true } +arboard = { version = "3.2.1", optional = true, default-features = false } +webbrowser = { version = "0.8.12", optional = true } mime_guess = { version = "2.0.4", optional = true } [features] diff --git a/crates/notan_winit/src/gl_manager.rs b/crates/notan_winit/src/gl_manager.rs index da4ac8de..884b5cf1 100644 --- a/crates/notan_winit/src/gl_manager.rs +++ b/crates/notan_winit/src/gl_manager.rs @@ -205,7 +205,7 @@ struct InnerSupport { } fn check_support(required_samples: u8, needs_transparency: bool, conf: &GConfig) -> InnerSupport { - let req_samples = conf.num_samples() == required_samples; + let req_samples = conf.num_samples() == required_samples && required_samples != 0; let srgb = conf.srgb_capable(); let supports_transparency = conf.supports_transparency().unwrap_or(false); let transparency = if needs_transparency { diff --git a/examples/egui_render_texture.rs b/examples/egui_render_texture.rs index 30f89885..913ebd6c 100644 --- a/examples/egui_render_texture.rs +++ b/examples/egui_render_texture.rs @@ -6,8 +6,7 @@ use notan::prelude::*; struct State { cube: Cube, render_texture: RenderTexture, - tex_id: egui::TextureId, - img_size: egui::Vec2, + sized_texture: SizedTexture, } impl State { @@ -20,14 +19,12 @@ impl State { .build() .unwrap(); - let img_size = render_texture.size().into(); - let tex_id = gfx.egui_register_texture(&render_texture); + let sized_texture = gfx.egui_register_texture(&render_texture); Self { - img_size, - tex_id, cube, render_texture, + sized_texture, } } } @@ -47,7 +44,7 @@ fn draw(app: &mut App, gfx: &mut Graphics, plugins: &mut Plugins, state: &mut St let mut output = plugins.egui(|ctx| { egui::Window::new("Notan Render Texture").show(ctx, |ui| { - ui.image(state.tex_id, state.img_size); + ui.image(state.sized_texture); }); }); output.clear_color(Color::BLACK); diff --git a/examples/egui_texture.rs b/examples/egui_texture.rs index 94e2fb55..b75b360d 100644 --- a/examples/egui_texture.rs +++ b/examples/egui_texture.rs @@ -3,8 +3,7 @@ use notan::prelude::*; #[derive(AppState)] struct State { - tex_id: egui::TextureId, - img_size: egui::Vec2, + sized_texture: egui::SizedTexture, } impl State { @@ -16,10 +15,9 @@ impl State { .build() .unwrap(); - let img_size: egui::Vec2 = texture.size().into(); - let tex_id = gfx.egui_register_texture(&texture); + let sized_texture = gfx.egui_register_texture(&texture); - Self { img_size, tex_id } + Self { sized_texture } } } @@ -34,7 +32,7 @@ fn main() -> Result<(), String> { fn draw(gfx: &mut Graphics, plugins: &mut Plugins, state: &mut State) { let mut output = plugins.egui(|ctx| { egui::Window::new("Notan Texture").show(ctx, |ui| { - ui.image(state.tex_id, state.img_size); + ui.image(state.sized_texture); }); });