wip: holy shit I have a black window!
This commit is contained in:
parent
4451c2e887
commit
9e1bb5db14
|
@ -122,11 +122,11 @@ defmodule Scenic.Driver.Renderling.Window do
|
|||
{:stop, :normal, driver}
|
||||
|
||||
:stop_system ->
|
||||
System.stop(:shutdown)
|
||||
System.stop(0)
|
||||
{:stop, :normal, driver}
|
||||
|
||||
:halt_system ->
|
||||
System.halt(:shutdown)
|
||||
System.halt(0)
|
||||
{:stop, :normal, driver}
|
||||
|
||||
{module, _fun, 1} ->
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"Renderling",
|
||||
"Rrect",
|
||||
"Stdio",
|
||||
"wgpu",
|
||||
"winit"
|
||||
]
|
||||
}
|
||||
|
|
421
native/renderling_window/Cargo.lock
generated
421
native/renderling_window/Cargo.lock
generated
|
@ -52,27 +52,6 @@ version = "0.2.18"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
|
||||
|
||||
[[package]]
|
||||
name = "android-activity"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289"
|
||||
dependencies = [
|
||||
"android-properties",
|
||||
"bitflags 2.5.0",
|
||||
"cc",
|
||||
"cesu8",
|
||||
"jni",
|
||||
"jni-sys",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk 0.8.0",
|
||||
"ndk-context",
|
||||
"ndk-sys 0.5.0+25.2.9519653",
|
||||
"num_enum",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "android-activity"
|
||||
version = "0.6.0"
|
||||
|
@ -87,7 +66,7 @@ dependencies = [
|
|||
"jni-sys",
|
||||
"libc",
|
||||
"log",
|
||||
"ndk 0.9.0",
|
||||
"ndk",
|
||||
"ndk-context",
|
||||
"ndk-sys 0.6.0+11769913",
|
||||
"num_enum",
|
||||
|
@ -268,32 +247,13 @@ version = "0.1.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
|
||||
|
||||
[[package]]
|
||||
name = "block-sys"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7"
|
||||
dependencies = [
|
||||
"objc-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block2"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68"
|
||||
dependencies = [
|
||||
"block-sys",
|
||||
"objc2 0.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "block2"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43ff7d91d3c1d568065b06c899777d1e48dcf76103a672a0adbc238a7f247f1e"
|
||||
dependencies = [
|
||||
"objc2 0.5.1",
|
||||
"objc2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -560,7 +520,7 @@ dependencies = [
|
|||
"glam",
|
||||
"log",
|
||||
"snafu",
|
||||
"wgpu 0.19.4",
|
||||
"wgpu",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -649,17 +609,6 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "d3d12"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b28bfe653d79bd16c77f659305b195b82bb5ce0c0eb2a4846b82ddbd77586813"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"libloading 0.8.3",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dagga"
|
||||
version = "0.2.1"
|
||||
|
@ -693,15 +642,6 @@ version = "0.3.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
|
||||
|
||||
[[package]]
|
||||
name = "document-features"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ef5282ad69563b5fc40319526ba27e0e7363d552a896f0297d54f767717f9b95"
|
||||
dependencies = [
|
||||
"litrs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dot2"
|
||||
version = "1.0.0"
|
||||
|
@ -1026,18 +966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"gpu-descriptor-types 0.1.2",
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"gpu-descriptor-types 0.2.0",
|
||||
"gpu-descriptor-types",
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
|
@ -1050,15 +979,6 @@ dependencies = [
|
|||
"bitflags 2.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor-types"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "half"
|
||||
version = "2.4.1"
|
||||
|
@ -1118,17 +1038,6 @@ version = "0.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
|
||||
|
||||
[[package]]
|
||||
name = "icrate"
|
||||
version = "0.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319"
|
||||
dependencies = [
|
||||
"block2 0.3.0",
|
||||
"dispatch",
|
||||
"objc2 0.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "image"
|
||||
version = "0.24.9"
|
||||
|
@ -1344,12 +1253,6 @@ version = "0.4.13"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
|
||||
|
||||
[[package]]
|
||||
name = "litrs"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
version = "0.4.12"
|
||||
|
@ -1405,21 +1308,6 @@ dependencies = [
|
|||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "metal"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5637e166ea14be6063a3f8ba5ccb9a4159df7d8f6d61c02fc3d480b1f90dcfcb"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"block",
|
||||
"core-graphics-types",
|
||||
"foreign-types",
|
||||
"log",
|
||||
"objc",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.7.2"
|
||||
|
@ -1463,42 +1351,6 @@ dependencies = [
|
|||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bit-set",
|
||||
"bitflags 2.5.0",
|
||||
"codespan-reporting",
|
||||
"hexf-parse",
|
||||
"indexmap",
|
||||
"log",
|
||||
"num-traits",
|
||||
"rustc-hash",
|
||||
"spirv",
|
||||
"termcolor",
|
||||
"thiserror",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"jni-sys",
|
||||
"log",
|
||||
"ndk-sys 0.5.0+25.2.9519653",
|
||||
"num_enum",
|
||||
"raw-window-handle",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ndk"
|
||||
version = "0.9.0"
|
||||
|
@ -1585,16 +1437,6 @@ version = "0.3.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da284c198fb9b7b0603f8635185e85fbd5b64ee154b1ed406d489077de2d6d60"
|
||||
|
||||
[[package]]
|
||||
name = "objc2"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d"
|
||||
dependencies = [
|
||||
"objc-sys",
|
||||
"objc2-encode 3.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2"
|
||||
version = "0.5.1"
|
||||
|
@ -1602,7 +1444,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "b4b25e1034d0e636cd84707ccdaa9f81243d399196b8a773946dcffec0401659"
|
||||
dependencies = [
|
||||
"objc-sys",
|
||||
"objc2-encode 4.0.1",
|
||||
"objc2-encode",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1611,8 +1453,8 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb79768a710a9a1798848179edb186d1af7e8a8679f369e4b8d201dd2a034047"
|
||||
dependencies = [
|
||||
"block2 0.5.0",
|
||||
"objc2 0.5.1",
|
||||
"block2",
|
||||
"objc2",
|
||||
"objc2-core-data",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
@ -1623,17 +1465,11 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e092bc42eaf30a08844e6a076938c60751225ec81431ab89f5d1ccd9f958d6c"
|
||||
dependencies = [
|
||||
"block2 0.5.0",
|
||||
"objc2 0.5.1",
|
||||
"block2",
|
||||
"objc2",
|
||||
"objc2-foundation",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "objc2-encode"
|
||||
version = "3.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666"
|
||||
|
||||
[[package]]
|
||||
name = "objc2-encode"
|
||||
version = "4.0.1"
|
||||
|
@ -1646,9 +1482,9 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfaefe14254871ea16c7d88968c0ff14ba554712a20d76421eec52f0a7fb8904"
|
||||
dependencies = [
|
||||
"block2 0.5.0",
|
||||
"block2",
|
||||
"dispatch",
|
||||
"objc2 0.5.1",
|
||||
"objc2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1920,15 +1756,6 @@ dependencies = [
|
|||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
|
||||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.4.1"
|
||||
|
@ -1984,9 +1811,9 @@ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
|
|||
|
||||
[[package]]
|
||||
name = "renderling"
|
||||
version = "0.4.1"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b132e3f0e36f563986c881c1ee66a7280b34397804ef5055fdf6bd2300012aff"
|
||||
checksum = "ef54807dde387f40271512dd3531f9a196a88cd9df4096b2b49e911b3aa7617e"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"bytemuck",
|
||||
|
@ -2004,8 +1831,8 @@ dependencies = [
|
|||
"serde_json",
|
||||
"snafu",
|
||||
"spirv-std",
|
||||
"wgpu 0.19.4",
|
||||
"winit 0.29.15",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2018,8 +1845,8 @@ dependencies = [
|
|||
"renderling",
|
||||
"rustler",
|
||||
"serde",
|
||||
"wgpu 0.20.0",
|
||||
"winit 0.30.0",
|
||||
"wgpu",
|
||||
"winit",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2102,19 +1929,6 @@ version = "1.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||
|
||||
[[package]]
|
||||
name = "sctk-adwaita"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550"
|
||||
dependencies = [
|
||||
"ab_glyph",
|
||||
"log",
|
||||
"memmap2",
|
||||
"smithay-client-toolkit",
|
||||
"tiny-skia",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sctk-adwaita"
|
||||
version = "0.9.0"
|
||||
|
@ -2729,16 +2543,6 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-time"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "web-time"
|
||||
version = "1.1.0"
|
||||
|
@ -2766,7 +2570,7 @@ dependencies = [
|
|||
"cfg_aliases 0.1.1",
|
||||
"js-sys",
|
||||
"log",
|
||||
"naga 0.19.2",
|
||||
"naga",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
|
@ -2775,35 +2579,9 @@ dependencies = [
|
|||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"wgpu-core 0.19.4",
|
||||
"wgpu-hal 0.19.4",
|
||||
"wgpu-types 0.19.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32ff1bfee408e1028e2e3acbf6d32d98b08a5a059ccbf5f33305534453ba5d3e"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"cfg-if",
|
||||
"cfg_aliases 0.1.1",
|
||||
"document-features",
|
||||
"js-sys",
|
||||
"log",
|
||||
"naga 0.20.0",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
"smallvec",
|
||||
"static_assertions",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
"wgpu-core 0.20.0",
|
||||
"wgpu-hal 0.20.0",
|
||||
"wgpu-types 0.20.0",
|
||||
"wgpu-core",
|
||||
"wgpu-hal",
|
||||
"wgpu-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2819,7 +2597,7 @@ dependencies = [
|
|||
"codespan-reporting",
|
||||
"indexmap",
|
||||
"log",
|
||||
"naga 0.19.2",
|
||||
"naga",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
|
@ -2828,35 +2606,8 @@ dependencies = [
|
|||
"smallvec",
|
||||
"thiserror",
|
||||
"web-sys",
|
||||
"wgpu-hal 0.19.4",
|
||||
"wgpu-types 0.19.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-core"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac6a86eaa5e763e59c73cf9e97d55fffd4dfda69fd8bda19589fcf851ddfef1f"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bit-vec",
|
||||
"bitflags 2.5.0",
|
||||
"cfg_aliases 0.1.1",
|
||||
"codespan-reporting",
|
||||
"document-features",
|
||||
"indexmap",
|
||||
"log",
|
||||
"naga 0.20.0",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
"rustc-hash",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"web-sys",
|
||||
"wgpu-hal 0.20.0",
|
||||
"wgpu-types 0.20.0",
|
||||
"wgpu-hal",
|
||||
"wgpu-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2873,20 +2624,20 @@ dependencies = [
|
|||
"block",
|
||||
"cfg_aliases 0.1.1",
|
||||
"core-graphics-types",
|
||||
"d3d12 0.19.0",
|
||||
"d3d12",
|
||||
"glow",
|
||||
"glutin_wgl_sys",
|
||||
"gpu-alloc",
|
||||
"gpu-allocator",
|
||||
"gpu-descriptor 0.2.4",
|
||||
"gpu-descriptor",
|
||||
"hassle-rs",
|
||||
"js-sys",
|
||||
"khronos-egl",
|
||||
"libc",
|
||||
"libloading 0.8.3",
|
||||
"log",
|
||||
"metal 0.27.0",
|
||||
"naga 0.19.2",
|
||||
"metal",
|
||||
"naga",
|
||||
"ndk-sys 0.5.0+25.2.9519653",
|
||||
"objc",
|
||||
"once_cell",
|
||||
|
@ -2900,52 +2651,7 @@ dependencies = [
|
|||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
"wgpu-types 0.19.2",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-hal"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d71c8ae05170583049b65ee562fd839fdc0b3e9ddb84f4e40c9d5f8ea0d4c8c"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"arrayvec",
|
||||
"ash",
|
||||
"bit-set",
|
||||
"bitflags 2.5.0",
|
||||
"block",
|
||||
"cfg_aliases 0.1.1",
|
||||
"core-graphics-types",
|
||||
"d3d12 0.20.0",
|
||||
"glow",
|
||||
"glutin_wgl_sys",
|
||||
"gpu-alloc",
|
||||
"gpu-allocator",
|
||||
"gpu-descriptor 0.3.0",
|
||||
"hassle-rs",
|
||||
"js-sys",
|
||||
"khronos-egl",
|
||||
"libc",
|
||||
"libloading 0.8.3",
|
||||
"log",
|
||||
"metal 0.28.0",
|
||||
"naga 0.20.0",
|
||||
"ndk-sys 0.5.0+25.2.9519653",
|
||||
"objc",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"range-alloc",
|
||||
"raw-window-handle",
|
||||
"renderdoc-sys",
|
||||
"rustc-hash",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
"wgpu-types 0.20.0",
|
||||
"wgpu-types",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
|
@ -2960,17 +2666,6 @@ dependencies = [
|
|||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-types"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1353d9a46bff7f955a680577f34c69122628cc2076e1d6f3a9be6ef00ae793ef"
|
||||
dependencies = [
|
||||
"bitflags 2.5.0",
|
||||
"js-sys",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "widestring"
|
||||
version = "1.1.0"
|
||||
|
@ -3241,54 +2936,6 @@ version = "0.52.5"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
|
||||
|
||||
[[package]]
|
||||
name = "winit"
|
||||
version = "0.29.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"android-activity 0.5.2",
|
||||
"atomic-waker",
|
||||
"bitflags 2.5.0",
|
||||
"bytemuck",
|
||||
"calloop",
|
||||
"cfg_aliases 0.1.1",
|
||||
"core-foundation",
|
||||
"core-graphics",
|
||||
"cursor-icon",
|
||||
"icrate",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"log",
|
||||
"memmap2",
|
||||
"ndk 0.8.0",
|
||||
"ndk-sys 0.5.0+25.2.9519653",
|
||||
"objc2 0.4.1",
|
||||
"once_cell",
|
||||
"orbclient",
|
||||
"percent-encoding",
|
||||
"raw-window-handle",
|
||||
"redox_syscall 0.3.5",
|
||||
"rustix",
|
||||
"sctk-adwaita 0.8.1",
|
||||
"smithay-client-toolkit",
|
||||
"smol_str",
|
||||
"unicode-segmentation",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"wayland-backend",
|
||||
"wayland-client",
|
||||
"wayland-protocols",
|
||||
"wayland-protocols-plasma",
|
||||
"web-sys",
|
||||
"web-time 0.2.4",
|
||||
"windows-sys 0.48.0",
|
||||
"x11-dl",
|
||||
"x11rb",
|
||||
"xkbcommon-dl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winit"
|
||||
version = "0.30.0"
|
||||
|
@ -3296,7 +2943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ea9e6d5d66cbf702e0dd820302144f51b69a95acdc495dd98ca280ff206562b1"
|
||||
dependencies = [
|
||||
"ahash",
|
||||
"android-activity 0.6.0",
|
||||
"android-activity",
|
||||
"atomic-waker",
|
||||
"bitflags 2.5.0",
|
||||
"bytemuck",
|
||||
|
@ -3310,8 +2957,8 @@ dependencies = [
|
|||
"js-sys",
|
||||
"libc",
|
||||
"memmap2",
|
||||
"ndk 0.9.0",
|
||||
"objc2 0.5.1",
|
||||
"ndk",
|
||||
"objc2",
|
||||
"objc2-app-kit",
|
||||
"objc2-foundation",
|
||||
"orbclient",
|
||||
|
@ -3320,7 +2967,7 @@ dependencies = [
|
|||
"raw-window-handle",
|
||||
"redox_syscall 0.4.1",
|
||||
"rustix",
|
||||
"sctk-adwaita 0.9.0",
|
||||
"sctk-adwaita",
|
||||
"serde",
|
||||
"smithay-client-toolkit",
|
||||
"smol_str",
|
||||
|
@ -3333,7 +2980,7 @@ dependencies = [
|
|||
"wayland-protocols",
|
||||
"wayland-protocols-plasma",
|
||||
"web-sys",
|
||||
"web-time 1.1.0",
|
||||
"web-time",
|
||||
"windows-sys 0.52.0",
|
||||
"x11-dl",
|
||||
"x11rb",
|
||||
|
|
|
@ -13,10 +13,10 @@ path = "src/lib.rs"
|
|||
anyhow = "1"
|
||||
clap = {version = "4", features = ["derive"]}
|
||||
ipc-channel = "0.18.0"
|
||||
renderling = "0.4.1"
|
||||
renderling = "0.4.2"
|
||||
rustler = {version = "0.32.1", features = ["serde", "nif_version_2_16"]}
|
||||
serde = {version = "1", features = ["derive"]}
|
||||
wgpu = "0.20.0"
|
||||
wgpu = {version = "0.19"}
|
||||
winit = {version = "0.30.0", features = ["serde"]}
|
||||
|
||||
[[bin]]
|
||||
|
|
|
@ -622,7 +622,7 @@ pub enum ModifierKey {
|
|||
ScrollLock,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
||||
pub struct Point {
|
||||
pub x: u32,
|
||||
pub y: u32,
|
||||
|
|
42
native/renderling_window/src/render.rs
Normal file
42
native/renderling_window/src/render.rs
Normal file
|
@ -0,0 +1,42 @@
|
|||
use renderling::{
|
||||
camera::Camera,
|
||||
math::{UVec2, Vec4},
|
||||
slab::Hybrid,
|
||||
stage::Stage,
|
||||
Context,
|
||||
};
|
||||
|
||||
pub struct Renderer {
|
||||
pub stage: Stage,
|
||||
pub ctx: Context,
|
||||
camera: Hybrid<Camera>,
|
||||
}
|
||||
|
||||
impl Renderer {
|
||||
pub fn new(ctx: Context) -> Self {
|
||||
let mut stage = ctx
|
||||
.new_stage()
|
||||
.with_lighting(false)
|
||||
.with_bloom(false)
|
||||
.with_background_color(Vec4::new(0.0, 0.0, 0.0, 1.0));
|
||||
|
||||
let size = ctx.get_size();
|
||||
let camera = stage.new_value(Camera::default_ortho2d(size.x as f32, size.y as f32));
|
||||
|
||||
Self { stage, camera, ctx }
|
||||
}
|
||||
|
||||
pub fn set_size(&mut self, width: u32, height: u32) {
|
||||
self.ctx.set_size(UVec2::new(width, height));
|
||||
}
|
||||
|
||||
pub fn redraw(&mut self) {
|
||||
self.ctx.get_device().poll(wgpu::Maintain::Wait);
|
||||
}
|
||||
|
||||
pub fn render_frame(&mut self) {
|
||||
let frame = self.ctx.get_next_frame().unwrap();
|
||||
self.stage.render(&frame.view());
|
||||
frame.present();
|
||||
}
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
mod elixir_types;
|
||||
mod message;
|
||||
mod render;
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::process::exit;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::message::{IpcExchange, Message};
|
||||
use clap::Parser;
|
||||
|
@ -10,6 +12,7 @@ use ipc_channel::ipc;
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
|
||||
use message::{InputClass, ModifierKey, OnClose, Orientation};
|
||||
|
||||
use winit::application::ApplicationHandler;
|
||||
use winit::dpi::{LogicalPosition, LogicalSize};
|
||||
use winit::event::{ElementState, KeyEvent, WindowEvent};
|
||||
|
@ -17,6 +20,10 @@ use winit::event_loop::{ActiveEventLoop, EventLoop};
|
|||
use winit::keyboard::{Key, NamedKey, PhysicalKey};
|
||||
use winit::window::{Window, WindowId};
|
||||
|
||||
use renderling::{math::UVec2, Context};
|
||||
|
||||
use crate::render::Renderer;
|
||||
|
||||
#[cfg(macos_platform)]
|
||||
use winit::platform::macos::{OptionAsAlt, WindowAttributesExtMacOS, WindowExtMacOS};
|
||||
#[cfg(any(x11_platform, wayland_platform))]
|
||||
|
@ -79,7 +86,8 @@ struct Application {
|
|||
width: u32,
|
||||
height: u32,
|
||||
on_close: OnClose,
|
||||
window: Option<Window>,
|
||||
window: Option<Arc<Window>>,
|
||||
renderer: Option<Renderer>,
|
||||
input_classes: Vec<InputClass>,
|
||||
sender: IpcSender<Message>,
|
||||
current_modifier_keys: HashSet<message::ModifierKey>,
|
||||
|
@ -124,6 +132,7 @@ impl Application {
|
|||
sender,
|
||||
current_modifier_keys: HashSet::default(),
|
||||
last_cursor_pos: message::Point { x: 0, y: 0 },
|
||||
renderer: None,
|
||||
},
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -259,13 +268,16 @@ impl ApplicationHandler<Message> for Application {
|
|||
}
|
||||
WindowEvent::CursorMoved { position, .. } => {
|
||||
let pos: message::Point = position.into();
|
||||
self.last_cursor_pos = pos.clone();
|
||||
|
||||
self.sender
|
||||
.send(Message::InputEvent(message::InputEvent::CursorPos {
|
||||
position: pos,
|
||||
}))
|
||||
.unwrap();
|
||||
if pos != self.last_cursor_pos {
|
||||
self.last_cursor_pos = pos.clone();
|
||||
|
||||
self.sender
|
||||
.send(Message::InputEvent(message::InputEvent::CursorPos {
|
||||
position: pos,
|
||||
}))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
WindowEvent::MouseInput { state, button, .. } => {
|
||||
self.sender
|
||||
|
@ -335,6 +347,16 @@ impl ApplicationHandler<Message> for Application {
|
|||
position: size.into(),
|
||||
}))
|
||||
.unwrap();
|
||||
|
||||
if let Some(renderer) = &mut self.renderer {
|
||||
renderer.set_size(size.width, size.height);
|
||||
}
|
||||
}
|
||||
|
||||
WindowEvent::RedrawRequested => {
|
||||
if let Some(renderer) = &mut self.renderer {
|
||||
renderer.redraw();
|
||||
}
|
||||
}
|
||||
|
||||
_ => println!("unhandled window event {:?}", event),
|
||||
|
@ -356,6 +378,20 @@ impl ApplicationHandler<Message> for Application {
|
|||
window_attributes
|
||||
};
|
||||
|
||||
self.window = event_loop.create_window(window_attributes).ok();
|
||||
let window = event_loop
|
||||
.create_window(window_attributes)
|
||||
.map(|window| Arc::new(window))
|
||||
.unwrap();
|
||||
|
||||
let context = Context::from_window(window.clone());
|
||||
|
||||
self.window = Some(window);
|
||||
self.renderer = Some(Renderer::new(context));
|
||||
}
|
||||
|
||||
fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) {
|
||||
if let Some(renderer) = &mut self.renderer {
|
||||
renderer.render_frame();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue