Ver código fonte

Added automatic debug tools, using vscode

Ghastrod 1 ano atrás
pai
commit
849da1bcb1
2 arquivos alterados com 69 adições e 2 exclusões
  1. 64 0
      .vscode/launch.json
  2. 5 2
      src/object.rs

+ 64 - 0
.vscode/launch.json

@@ -0,0 +1,64 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug unit tests in library 'wgpu5'",
+            "cargo": {
+                "args": [
+                    "test",
+                    "--no-run",
+                    "--lib",
+                    "--package=wgpu5"
+                ],
+                "filter": {
+                    "name": "wgpu5",
+                    "kind": "lib"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        },
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug executable 'wgpu5'",
+            "cargo": {
+                "args": [
+                    "build",
+                    "--bin=wgpu5",
+                    "--package=wgpu5"
+                ],
+                "filter": {
+                    "name": "wgpu5",
+                    "kind": "bin"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        },
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug unit tests in executable 'wgpu5'",
+            "cargo": {
+                "args": [
+                    "test",
+                    "--no-run",
+                    "--bin=wgpu5",
+                    "--package=wgpu5"
+                ],
+                "filter": {
+                    "name": "wgpu5",
+                    "kind": "bin"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        }
+    ]
+}

+ 5 - 2
src/object.rs

@@ -58,9 +58,12 @@ pub fn generate_plane(num_segx: u32, num_segy: u32, width: f32, height: f32) ->
     let mut y = -height_half;
 
     let mut seg_y = 0;
+    let mut seg_x = 0;
     while seg_y < num_segy {
-        let mut seg_x = 0;
+        seg_x = 0;
         while seg_x < num_segx {
+            //println!("Boucle interne numéro {}, avec y = {}",seg_x,seg_y);
+
             let x0 = x;
             let y0 = y;
             let x1 = x + xstep;
@@ -108,4 +111,4 @@ pub fn generate_plane(num_segx: u32, num_segy: u32, width: f32, height: f32) ->
     }
 
     result
-}
+}