Parcourir la source

Added internet possibilities, without testing it first

Ghastrod il y a 1 an
Parent
commit
99eddb32c8
4 fichiers modifiés avec 46 ajouts et 1 suppressions
  1. 3 1
      .gitignore
  2. 25 0
      Cargo.lock
  3. 13 0
      Cargo.toml
  4. 5 0
      index.html

+ 3 - 1
.gitignore

@@ -1,2 +1,4 @@
 /target
-log.txt
+log.txt
+/dist
+/build

+ 25 - 0
Cargo.lock

@@ -395,6 +395,26 @@ dependencies = [
  "crossbeam-utils",
 ]
 
+[[package]]
+name = "console_error_panic_hook"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
+dependencies = [
+ "cfg-if",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "console_log"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f"
+dependencies = [
+ "log",
+ "web-sys",
+]
+
 [[package]]
 name = "core-foundation"
 version = "0.9.4"
@@ -1874,10 +1894,15 @@ dependencies = [
  "bytemuck",
  "cfg-if",
  "chrono",
+ "console_error_panic_hook",
+ "console_log",
  "env_logger",
  "glam",
  "log",
  "pollster",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
  "wgpu",
  "winit",
 ]

+ 13 - 0
Cargo.toml

@@ -13,3 +13,16 @@ pollster = "0.3.0"
 bytemuck = { version = "1.16.0", features = ["derive"] }
 glam = "0.27.0"
 chrono = "0.4.38"
+
+
+[target.'cfg(target_arch = "wasm32")'.dependencies]
+console_error_panic_hook = "0.1.6"
+console_log = "1.0"
+wgpu = { version = "0.19", features = ["webgl"]}
+wasm-bindgen = "0.2"
+wasm-bindgen-futures = "0.4.30"
+web-sys = { version = "0.3", features = [
+    "Document",
+    "Window",
+    "Element",
+]}

+ 5 - 0
index.html

@@ -0,0 +1,5 @@
+<html>
+    <head>
+        <title>My First Web Page</title>
+    </head>
+</html>