├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Readme.md ├── assets ├── fonts │ └── NotoSans │ │ ├── LICENSE-2.0.txt │ │ ├── NotoSans-Bold.ttf │ │ ├── NotoSans-BoldItalic.ttf │ │ ├── NotoSans-Italic.ttf │ │ └── NotoSans-Regular.ttf └── images │ └── faiyels-demo2.gif ├── shader ├── instancing_150.glslf └── instancing_150.glslv └── src ├── layout.rs ├── main.rs └── particle_renderer.rs /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | [root] 2 | name = "faiyels" 3 | version = "0.1.0" 4 | dependencies = [ 5 | "cgmath 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", 6 | "conrod 0.35.0 (registry+https://github.com/rust-lang/crates.io-index)", 7 | "find_folder 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 8 | "gfx 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 9 | "piston_window 0.47.0 (registry+https://github.com/rust-lang/crates.io-index)", 10 | "syntect 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 11 | "vecmath 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 12 | "walkdir 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 13 | ] 14 | 15 | [[package]] 16 | name = "android_glue" 17 | version = "0.1.3" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | 20 | [[package]] 21 | name = "arrayvec" 22 | version = "0.3.16" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | dependencies = [ 25 | "nodrop 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", 26 | "odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 27 | ] 28 | 29 | [[package]] 30 | name = "bincode" 31 | version = "0.5.8" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | dependencies = [ 34 | "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 35 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 36 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 37 | "serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", 38 | ] 39 | 40 | [[package]] 41 | name = "bitflags" 42 | version = "0.3.3" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | 45 | [[package]] 46 | name = "bitflags" 47 | version = "0.4.0" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | 50 | [[package]] 51 | name = "bitflags" 52 | version = "0.6.0" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | 55 | [[package]] 56 | name = "bitflags" 57 | version = "0.7.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | 60 | [[package]] 61 | name = "byteorder" 62 | version = "0.4.2" 63 | source = "registry+https://github.com/rust-lang/crates.io-index" 64 | 65 | [[package]] 66 | name = "byteorder" 67 | version = "0.5.1" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | 70 | [[package]] 71 | name = "cgl" 72 | version = "0.1.4" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | dependencies = [ 75 | "gleam 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", 76 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 77 | ] 78 | 79 | [[package]] 80 | name = "cgmath" 81 | version = "0.9.1" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | dependencies = [ 84 | "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 85 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 86 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 87 | ] 88 | 89 | [[package]] 90 | name = "chrono" 91 | version = "0.2.22" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | dependencies = [ 94 | "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 95 | "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", 96 | ] 97 | 98 | [[package]] 99 | name = "cmake" 100 | version = "0.1.17" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | dependencies = [ 103 | "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)", 104 | ] 105 | 106 | [[package]] 107 | name = "cocoa" 108 | version = "0.3.2" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | dependencies = [ 111 | "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 112 | "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 113 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 114 | "objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 115 | ] 116 | 117 | [[package]] 118 | name = "color_quant" 119 | version = "1.0.0" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | 122 | [[package]] 123 | name = "conrod" 124 | version = "0.35.0" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | dependencies = [ 127 | "daggy 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 128 | "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 129 | "piston2d-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 130 | "pistoncore-input 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 131 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 132 | "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", 133 | "vecmath 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 134 | ] 135 | 136 | [[package]] 137 | name = "core-foundation" 138 | version = "0.2.1" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | dependencies = [ 141 | "core-foundation-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 142 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 143 | ] 144 | 145 | [[package]] 146 | name = "core-foundation-sys" 147 | version = "0.2.1" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | dependencies = [ 150 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 151 | ] 152 | 153 | [[package]] 154 | name = "core-graphics" 155 | version = "0.3.0" 156 | source = "registry+https://github.com/rust-lang/crates.io-index" 157 | dependencies = [ 158 | "core-foundation 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 159 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 160 | "serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", 161 | ] 162 | 163 | [[package]] 164 | name = "crossbeam" 165 | version = "0.2.9" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | 168 | [[package]] 169 | name = "daggy" 170 | version = "0.4.0" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | dependencies = [ 173 | "petgraph 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", 174 | ] 175 | 176 | [[package]] 177 | name = "deque" 178 | version = "0.3.1" 179 | source = "registry+https://github.com/rust-lang/crates.io-index" 180 | dependencies = [ 181 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 182 | ] 183 | 184 | [[package]] 185 | name = "dlib" 186 | version = "0.3.0" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | dependencies = [ 189 | "libloading 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 190 | ] 191 | 192 | [[package]] 193 | name = "draw_state" 194 | version = "0.6.0" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | dependencies = [ 197 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 198 | ] 199 | 200 | [[package]] 201 | name = "dwmapi-sys" 202 | version = "0.1.0" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | dependencies = [ 205 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 206 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 207 | ] 208 | 209 | [[package]] 210 | name = "dylib" 211 | version = "0.0.1" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | dependencies = [ 214 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 215 | ] 216 | 217 | [[package]] 218 | name = "enum_primitive" 219 | version = "0.1.0" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | dependencies = [ 222 | "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 223 | ] 224 | 225 | [[package]] 226 | name = "euclid" 227 | version = "0.6.6" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | dependencies = [ 230 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 231 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 232 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 233 | ] 234 | 235 | [[package]] 236 | name = "find_folder" 237 | version = "0.3.0" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | 240 | [[package]] 241 | name = "fixedbitset" 242 | version = "0.1.0" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | 245 | [[package]] 246 | name = "flate2" 247 | version = "0.2.14" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | dependencies = [ 250 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 251 | "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 252 | ] 253 | 254 | [[package]] 255 | name = "fnv" 256 | version = "1.0.2" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | 259 | [[package]] 260 | name = "fs2" 261 | version = "0.2.4" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | dependencies = [ 264 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 265 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 266 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 267 | ] 268 | 269 | [[package]] 270 | name = "gcc" 271 | version = "0.3.28" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | 274 | [[package]] 275 | name = "gdi32-sys" 276 | version = "0.1.1" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | dependencies = [ 279 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 280 | ] 281 | 282 | [[package]] 283 | name = "gfx" 284 | version = "0.11.0" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | dependencies = [ 287 | "draw_state 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 288 | "gfx_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 289 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 290 | ] 291 | 292 | [[package]] 293 | name = "gfx_core" 294 | version = "0.3.1" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | dependencies = [ 297 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 298 | "draw_state 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 299 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 300 | ] 301 | 302 | [[package]] 303 | name = "gfx_device_gl" 304 | version = "0.10.0" 305 | source = "registry+https://github.com/rust-lang/crates.io-index" 306 | dependencies = [ 307 | "gfx_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 308 | "gfx_gl 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 309 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 310 | ] 311 | 312 | [[package]] 313 | name = "gfx_gl" 314 | version = "0.3.1" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | dependencies = [ 317 | "gl_generator 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 318 | ] 319 | 320 | [[package]] 321 | name = "gif" 322 | version = "0.8.0" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | dependencies = [ 325 | "color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 326 | "lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 327 | ] 328 | 329 | [[package]] 330 | name = "gl" 331 | version = "0.6.0" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | dependencies = [ 334 | "gl_generator 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 335 | ] 336 | 337 | [[package]] 338 | name = "gl_generator" 339 | version = "0.5.1" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | dependencies = [ 342 | "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", 343 | "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", 344 | "xml-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 345 | ] 346 | 347 | [[package]] 348 | name = "gleam" 349 | version = "0.2.18" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | dependencies = [ 352 | "gl_generator 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 353 | ] 354 | 355 | [[package]] 356 | name = "glob" 357 | version = "0.2.11" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | 360 | [[package]] 361 | name = "glutin" 362 | version = "0.5.1" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | dependencies = [ 365 | "android_glue 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 366 | "cgl 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 367 | "cocoa 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 368 | "core-foundation 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 369 | "core-graphics 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 370 | "dwmapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 371 | "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 372 | "gl_generator 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 373 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 374 | "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 375 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 376 | "objc 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 377 | "osmesa-sys 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", 378 | "shared_library 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 379 | "shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 380 | "user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", 381 | "wayland-client 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 382 | "wayland-kbd 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", 383 | "wayland-window 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 384 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 385 | "x11-dl 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 386 | ] 387 | 388 | [[package]] 389 | name = "image" 390 | version = "0.10.0" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | dependencies = [ 393 | "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 394 | "enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 395 | "gif 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 396 | "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 397 | "jpeg-decoder 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 398 | "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 399 | "num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 400 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 401 | "png 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", 402 | ] 403 | 404 | [[package]] 405 | name = "inflate" 406 | version = "0.1.1" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | 409 | [[package]] 410 | name = "interpolation" 411 | version = "0.1.0" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | 414 | [[package]] 415 | name = "itertools" 416 | version = "0.4.13" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | 419 | [[package]] 420 | name = "jpeg-decoder" 421 | version = "0.1.4" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | dependencies = [ 424 | "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 425 | "euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", 426 | "num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 427 | "rayon 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 428 | ] 429 | 430 | [[package]] 431 | name = "kernel32-sys" 432 | version = "0.2.2" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | dependencies = [ 435 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 436 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 437 | ] 438 | 439 | [[package]] 440 | name = "khronos_api" 441 | version = "1.0.0" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | 444 | [[package]] 445 | name = "lazy_static" 446 | version = "0.1.16" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | 449 | [[package]] 450 | name = "lazy_static" 451 | version = "0.2.1" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | 454 | [[package]] 455 | name = "libc" 456 | version = "0.2.11" 457 | source = "registry+https://github.com/rust-lang/crates.io-index" 458 | 459 | [[package]] 460 | name = "libloading" 461 | version = "0.2.2" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | dependencies = [ 464 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 465 | "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 466 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 467 | ] 468 | 469 | [[package]] 470 | name = "linked-hash-map" 471 | version = "0.0.9" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | 474 | [[package]] 475 | name = "log" 476 | version = "0.3.6" 477 | source = "registry+https://github.com/rust-lang/crates.io-index" 478 | 479 | [[package]] 480 | name = "lzw" 481 | version = "0.10.0" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | 484 | [[package]] 485 | name = "malloc_buf" 486 | version = "0.0.6" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | dependencies = [ 489 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 490 | ] 491 | 492 | [[package]] 493 | name = "memmap" 494 | version = "0.2.3" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | dependencies = [ 497 | "fs2 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", 498 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 499 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 500 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 501 | ] 502 | 503 | [[package]] 504 | name = "miniz-sys" 505 | version = "0.1.7" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | dependencies = [ 508 | "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)", 509 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 510 | ] 511 | 512 | [[package]] 513 | name = "ndarray" 514 | version = "0.3.1" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | dependencies = [ 517 | "itertools 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)", 518 | "num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 519 | "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 520 | ] 521 | 522 | [[package]] 523 | name = "nodrop" 524 | version = "0.1.6" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | dependencies = [ 527 | "odds 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", 528 | ] 529 | 530 | [[package]] 531 | name = "num" 532 | version = "0.1.32" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | dependencies = [ 535 | "num-bigint 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 536 | "num-complex 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 537 | "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 538 | "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 539 | "num-rational 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 540 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 541 | ] 542 | 543 | [[package]] 544 | name = "num-bigint" 545 | version = "0.1.32" 546 | source = "registry+https://github.com/rust-lang/crates.io-index" 547 | dependencies = [ 548 | "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 549 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 550 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 551 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 552 | ] 553 | 554 | [[package]] 555 | name = "num-complex" 556 | version = "0.1.32" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | dependencies = [ 559 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 560 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 561 | ] 562 | 563 | [[package]] 564 | name = "num-integer" 565 | version = "0.1.32" 566 | source = "registry+https://github.com/rust-lang/crates.io-index" 567 | dependencies = [ 568 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 569 | ] 570 | 571 | [[package]] 572 | name = "num-iter" 573 | version = "0.1.32" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | dependencies = [ 576 | "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 577 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 578 | ] 579 | 580 | [[package]] 581 | name = "num-rational" 582 | version = "0.1.32" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | dependencies = [ 585 | "num-bigint 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 586 | "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 587 | "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 588 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 589 | ] 590 | 591 | [[package]] 592 | name = "num-traits" 593 | version = "0.1.32" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | 596 | [[package]] 597 | name = "num_cpus" 598 | version = "0.2.11" 599 | source = "registry+https://github.com/rust-lang/crates.io-index" 600 | dependencies = [ 601 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 602 | ] 603 | 604 | [[package]] 605 | name = "objc" 606 | version = "0.2.1" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | dependencies = [ 609 | "malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", 610 | ] 611 | 612 | [[package]] 613 | name = "odds" 614 | version = "0.2.12" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | 617 | [[package]] 618 | name = "onig" 619 | version = "0.6.0" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | dependencies = [ 622 | "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", 623 | "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 624 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 625 | "onig_sys 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", 626 | ] 627 | 628 | [[package]] 629 | name = "onig_sys" 630 | version = "0.8.0" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | dependencies = [ 633 | "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", 634 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 635 | "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", 636 | ] 637 | 638 | [[package]] 639 | name = "osmesa-sys" 640 | version = "0.0.5" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | dependencies = [ 643 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 644 | "shared_library 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", 645 | ] 646 | 647 | [[package]] 648 | name = "petgraph" 649 | version = "0.2.7" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | dependencies = [ 652 | "fixedbitset 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 653 | ] 654 | 655 | [[package]] 656 | name = "piston" 657 | version = "0.22.0" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | dependencies = [ 660 | "pistoncore-event_loop 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", 661 | "pistoncore-input 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 662 | "pistoncore-window 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", 663 | ] 664 | 665 | [[package]] 666 | name = "piston-float" 667 | version = "0.2.0" 668 | source = "registry+https://github.com/rust-lang/crates.io-index" 669 | 670 | [[package]] 671 | name = "piston-gfx_texture" 672 | version = "0.15.0" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | dependencies = [ 675 | "gfx 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 676 | "gfx_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 677 | "image 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 678 | "piston-texture 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 679 | ] 680 | 681 | [[package]] 682 | name = "piston-shaders_graphics2d" 683 | version = "0.2.1" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | 686 | [[package]] 687 | name = "piston-texture" 688 | version = "0.4.0" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | 691 | [[package]] 692 | name = "piston-viewport" 693 | version = "0.2.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | dependencies = [ 696 | "piston-float 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 697 | ] 698 | 699 | [[package]] 700 | name = "piston2d-gfx_graphics" 701 | version = "0.28.0" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | dependencies = [ 704 | "draw_state 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 705 | "gfx 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 706 | "piston-gfx_texture 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", 707 | "piston-shaders_graphics2d 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 708 | "piston2d-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 709 | "rusttype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 710 | "shader_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 711 | ] 712 | 713 | [[package]] 714 | name = "piston2d-graphics" 715 | version = "0.16.0" 716 | source = "registry+https://github.com/rust-lang/crates.io-index" 717 | dependencies = [ 718 | "interpolation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 719 | "piston-texture 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 720 | "piston-viewport 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 721 | "read_color 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 722 | "vecmath 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 723 | ] 724 | 725 | [[package]] 726 | name = "piston_window" 727 | version = "0.47.0" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | dependencies = [ 730 | "gfx 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", 731 | "gfx_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 732 | "gfx_device_gl 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", 733 | "piston 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", 734 | "piston2d-gfx_graphics 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", 735 | "piston2d-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", 736 | "pistoncore-glutin_window 0.26.0 (registry+https://github.com/rust-lang/crates.io-index)", 737 | "shader_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 738 | ] 739 | 740 | [[package]] 741 | name = "pistoncore-event_loop" 742 | version = "0.22.0" 743 | source = "registry+https://github.com/rust-lang/crates.io-index" 744 | dependencies = [ 745 | "piston-viewport 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 746 | "pistoncore-input 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 747 | "pistoncore-window 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", 748 | "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", 749 | ] 750 | 751 | [[package]] 752 | name = "pistoncore-glutin_window" 753 | version = "0.26.0" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | dependencies = [ 756 | "gl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 757 | "glutin 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 758 | "pistoncore-input 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 759 | "pistoncore-window 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", 760 | "shader_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 761 | ] 762 | 763 | [[package]] 764 | name = "pistoncore-input" 765 | version = "0.12.0" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | dependencies = [ 768 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 769 | "piston-viewport 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 770 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 771 | ] 772 | 773 | [[package]] 774 | name = "pistoncore-window" 775 | version = "0.19.0" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | dependencies = [ 778 | "pistoncore-input 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", 779 | "shader_version 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 780 | ] 781 | 782 | [[package]] 783 | name = "pkg-config" 784 | version = "0.3.8" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | 787 | [[package]] 788 | name = "plist" 789 | version = "0.0.13" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | dependencies = [ 792 | "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 793 | "chrono 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", 794 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 795 | "serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", 796 | "xml-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 797 | ] 798 | 799 | [[package]] 800 | name = "png" 801 | version = "0.5.0" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | dependencies = [ 804 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 805 | "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", 806 | "inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 807 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 808 | "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", 809 | ] 810 | 811 | [[package]] 812 | name = "rand" 813 | version = "0.3.14" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | dependencies = [ 816 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 817 | ] 818 | 819 | [[package]] 820 | name = "rayon" 821 | version = "0.3.1" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | dependencies = [ 824 | "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 825 | "num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 826 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 827 | ] 828 | 829 | [[package]] 830 | name = "read_color" 831 | version = "0.1.0" 832 | source = "registry+https://github.com/rust-lang/crates.io-index" 833 | 834 | [[package]] 835 | name = "regex-syntax" 836 | version = "0.3.3" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | 839 | [[package]] 840 | name = "rustc-serialize" 841 | version = "0.3.19" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | 844 | [[package]] 845 | name = "rustc_version" 846 | version = "0.1.7" 847 | source = "registry+https://github.com/rust-lang/crates.io-index" 848 | dependencies = [ 849 | "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", 850 | ] 851 | 852 | [[package]] 853 | name = "rusttype" 854 | version = "0.2.0" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | dependencies = [ 857 | "arrayvec 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", 858 | "linked-hash-map 0.0.9 (registry+https://github.com/rust-lang/crates.io-index)", 859 | "ndarray 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 860 | "stb_truetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 861 | ] 862 | 863 | [[package]] 864 | name = "semver" 865 | version = "0.1.20" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | 868 | [[package]] 869 | name = "serde" 870 | version = "0.7.4" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | 873 | [[package]] 874 | name = "shader_version" 875 | version = "0.2.1" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | 878 | [[package]] 879 | name = "shared_library" 880 | version = "0.1.4" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | dependencies = [ 883 | "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 884 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 885 | ] 886 | 887 | [[package]] 888 | name = "shell32-sys" 889 | version = "0.1.1" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | dependencies = [ 892 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 893 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 894 | ] 895 | 896 | [[package]] 897 | name = "stb_truetype" 898 | version = "0.2.0" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | dependencies = [ 901 | "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", 902 | ] 903 | 904 | [[package]] 905 | name = "syntect" 906 | version = "0.7.0" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | dependencies = [ 909 | "bincode 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", 910 | "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 911 | "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", 912 | "fnv 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", 913 | "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", 914 | "onig 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 915 | "plist 0.0.13 (registry+https://github.com/rust-lang/crates.io-index)", 916 | "regex-syntax 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 917 | "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", 918 | "walkdir 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", 919 | "yaml-rust 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 920 | ] 921 | 922 | [[package]] 923 | name = "tempfile" 924 | version = "2.1.3" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | dependencies = [ 927 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 928 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 929 | "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", 930 | "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", 931 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 932 | ] 933 | 934 | [[package]] 935 | name = "time" 936 | version = "0.1.35" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | dependencies = [ 939 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 940 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 941 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 942 | ] 943 | 944 | [[package]] 945 | name = "user32-sys" 946 | version = "0.1.2" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | dependencies = [ 949 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 950 | "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", 951 | ] 952 | 953 | [[package]] 954 | name = "vecmath" 955 | version = "0.2.0" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | dependencies = [ 958 | "piston-float 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 959 | ] 960 | 961 | [[package]] 962 | name = "walkdir" 963 | version = "0.1.5" 964 | source = "registry+https://github.com/rust-lang/crates.io-index" 965 | dependencies = [ 966 | "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", 967 | "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", 968 | ] 969 | 970 | [[package]] 971 | name = "wayland-client" 972 | version = "0.5.11" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | dependencies = [ 975 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 976 | "crossbeam 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", 977 | "dlib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 978 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 979 | "wayland-scanner 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 980 | "wayland-sys 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 981 | ] 982 | 983 | [[package]] 984 | name = "wayland-kbd" 985 | version = "0.3.5" 986 | source = "registry+https://github.com/rust-lang/crates.io-index" 987 | dependencies = [ 988 | "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", 989 | "dlib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 990 | "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 991 | "memmap 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", 992 | "wayland-client 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 993 | ] 994 | 995 | [[package]] 996 | name = "wayland-scanner" 997 | version = "0.5.11" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | dependencies = [ 1000 | "xml-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "wayland-sys" 1005 | version = "0.5.11" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | dependencies = [ 1008 | "dlib 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", 1009 | "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", 1010 | ] 1011 | 1012 | [[package]] 1013 | name = "wayland-window" 1014 | version = "0.2.3" 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" 1016 | dependencies = [ 1017 | "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", 1018 | "tempfile 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", 1019 | "wayland-client 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", 1020 | ] 1021 | 1022 | [[package]] 1023 | name = "winapi" 1024 | version = "0.2.6" 1025 | source = "registry+https://github.com/rust-lang/crates.io-index" 1026 | 1027 | [[package]] 1028 | name = "winapi-build" 1029 | version = "0.1.1" 1030 | source = "registry+https://github.com/rust-lang/crates.io-index" 1031 | 1032 | [[package]] 1033 | name = "x11-dl" 1034 | version = "2.4.0" 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" 1036 | dependencies = [ 1037 | "dylib 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1038 | "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", 1039 | ] 1040 | 1041 | [[package]] 1042 | name = "xml-rs" 1043 | version = "0.3.2" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | dependencies = [ 1046 | "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", 1047 | ] 1048 | 1049 | [[package]] 1050 | name = "yaml-rust" 1051 | version = "0.3.3" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | 1054 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "faiyels" 3 | version = "0.1.0" 4 | authors = ["Tristan Hume "] 5 | 6 | [dependencies] 7 | conrod = "0.35.0" 8 | find_folder = "0.3.0" 9 | vecmath = "0.2.0" 10 | piston_window = "0.47.0" 11 | gfx = "0.11.0" 12 | cgmath = "0.9.1" 13 | walkdir = "0.1.5" 14 | syntect = "0.7.0" 15 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # faiyels 2 | 3 | Faiyels is a source code visualizer that shows the code in all the files of your program in a massive overview kind of like 4 | Sublime Text's minimap so you can see the size and texture of all the files. It uses my [syntect](https://github.com/trishume/syntect) library to do syntax highlighting. 5 | It is written in Rust using Gfx and Conrod. It is currently quite basic and just shows all the files in a directory and lets you zoom around. 6 | 7 | It's reasonably fast and can render millions of boxes at 60fps thanks to instancing, and the fact that each character is just 2 polygons. 8 | 9 | ![Demo GIF](/assets/images/faiyels-demo2.gif) 10 | 11 | ## Roadmap 12 | - [x] Draw lots of rectangles 13 | - [x] Draw lots of rectangles in the same places as a piece of text 14 | - [x] Draw lots of rectangles in the same places as the text in a file 15 | - [x] Add controls to navigate and zoom around 16 | - [x] Draw many files at once in a useful arrangement 17 | - [x] Colour the rectangles according to syntax highlighting 18 | - [ ] Show actual letters when you zoom in enough 19 | -------------------------------------------------------------------------------- /assets/fonts/NotoSans/LICENSE-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /assets/fonts/NotoSans/NotoSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trishume/faiyels/851adc102bcc1d0afb8d38711755e64e0d6d26ce/assets/fonts/NotoSans/NotoSans-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/NotoSans/NotoSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trishume/faiyels/851adc102bcc1d0afb8d38711755e64e0d6d26ce/assets/fonts/NotoSans/NotoSans-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/NotoSans/NotoSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trishume/faiyels/851adc102bcc1d0afb8d38711755e64e0d6d26ce/assets/fonts/NotoSans/NotoSans-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/NotoSans/NotoSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trishume/faiyels/851adc102bcc1d0afb8d38711755e64e0d6d26ce/assets/fonts/NotoSans/NotoSans-Regular.ttf -------------------------------------------------------------------------------- /assets/images/faiyels-demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trishume/faiyels/851adc102bcc1d0afb8d38711755e64e0d6d26ce/assets/images/faiyels-demo2.gif -------------------------------------------------------------------------------- /shader/instancing_150.glslf: -------------------------------------------------------------------------------- 1 | #version 150 core 2 | 3 | in vec4 v_Color; 4 | 5 | out vec4 Target0; 6 | 7 | void main() { 8 | Target0 = v_Color; 9 | } 10 | -------------------------------------------------------------------------------- /shader/instancing_150.glslv: -------------------------------------------------------------------------------- 1 | #version 150 core 2 | 3 | in vec2 a_Position; 4 | in vec2 a_Translate; 5 | in uint a_Color; 6 | 7 | uniform b_VsLocals { 8 | mat4 u_Transform; 9 | }; 10 | 11 | out vec4 v_Color; 12 | 13 | void main() { 14 | gl_Position = u_Transform*vec4(a_Position + a_Translate, 0.0, 1.0); 15 | 16 | uint u8mask = 0x000000FFu; 17 | v_Color = vec4(float( a_Color >> 24), 18 | float((a_Color >> 16) & u8mask), 19 | float((a_Color >> 8) & u8mask), 20 | float( a_Color & u8mask)) / 255.0; 21 | } 22 | -------------------------------------------------------------------------------- /src/layout.rs: -------------------------------------------------------------------------------- 1 | use particle_renderer::{Instance}; 2 | use std::io::prelude::*; 3 | use std::path::{Path}; 4 | use walkdir::WalkDir; 5 | use syntect::parsing::SyntaxSet; 6 | use syntect::highlighting::{ThemeSet, Theme, Color}; 7 | use syntect::easy::HighlightFile; 8 | 9 | fn color_to_u32(c: Color) -> u32 { 10 | ((c.r as u32) << (3*8)) | 11 | ((c.g as u32) << (2*8)) | 12 | ((c.b as u32) << (1*8)) | 13 | ((c.a as u32) << (0*8)) 14 | } 15 | 16 | pub fn layout_file_at(path: &Path, x: f32, y: f32, v: &mut Vec, ss: &SyntaxSet, theme: &Theme) { 17 | let offset = 1.0 + 0.4; // size + gap 18 | 19 | let x_begin = x+0.5; 20 | let mut translate = [x_begin, y+0.5]; 21 | 22 | let mut highlighter = HighlightFile::new(path, &ss, theme).unwrap(); 23 | for maybe_line in highlighter.reader.lines() { 24 | let line = maybe_line.unwrap(); 25 | let regions = highlighter.highlight_lines.highlight(&line); 26 | let mut column = 0; 27 | for &(ref style, s) in ®ions { 28 | for c in s.chars() { 29 | if !c.is_whitespace() { 30 | v.push(Instance { 31 | translate: translate, 32 | color: color_to_u32(style.foreground), 33 | }); 34 | } 35 | 36 | translate[0] += offset; 37 | column += 1; 38 | 39 | if column >= 100 { 40 | translate[0] = x_begin; 41 | translate[1] -= offset; 42 | column = 0; 43 | } 44 | } 45 | } 46 | translate[0] = x_begin; 47 | translate[1] -= offset; 48 | } 49 | } 50 | 51 | pub fn layout_dir(path: &Path) -> Vec { 52 | let ss = SyntaxSet::load_defaults_nonewlines(); 53 | let ts = ThemeSet::load_defaults(); 54 | let mut v = Vec::new(); 55 | let mut x = 0.0; 56 | for entry in WalkDir::new(path).into_iter().filter_map(|e| e.ok()) { 57 | println!("{}", entry.path().display()); 58 | if entry.file_type().is_file() { 59 | layout_file_at(entry.path(), x, 0.0, &mut v, &ss, &ts.themes["base16-ocean.dark"]); 60 | x += 142.0; 61 | } 62 | } 63 | return v; 64 | } 65 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] extern crate conrod; 2 | #[macro_use] extern crate gfx; 3 | extern crate find_folder; 4 | extern crate piston_window; 5 | extern crate vecmath; 6 | extern crate cgmath; 7 | extern crate walkdir; 8 | extern crate syntect; 9 | mod particle_renderer; 10 | mod layout; 11 | 12 | use std::path::Path; 13 | use std::env; 14 | 15 | pub fn main() { 16 | use conrod::{self, Colorable, Labelable, Positionable, Sizeable, Widget, Button}; 17 | use piston_window::{EventLoop, Glyphs, PistonWindow, OpenGL, UpdateEvent, WindowSettings, Window, Event, Input, Motion}; 18 | 19 | // Conrod is backend agnostic. Here, we define the `piston_window` backend to use for our `Ui`. 20 | type Backend = ( as conrod::Graphics>::Texture, Glyphs); 21 | type Ui = conrod::Ui; 22 | 23 | // Change this to OpenGL::V2_1 if not working. 24 | let opengl = OpenGL::V3_2; 25 | 26 | // PistonWindow has two type parameters, but the default type is 27 | // PistonWindow. To change the Piston backend, 28 | // specify a different type in the let binding, e.g. 29 | // let window: PistonWindow<(), Sdl2Window>. 30 | let mut window: PistonWindow = WindowSettings::new("Control Panel", [1300, 1000]) 31 | .opengl(opengl) 32 | .exit_on_esc(true) 33 | .build().unwrap(); 34 | 35 | // Conrod's main object. 36 | let mut ui = { 37 | // Load a font. `Glyphs` is provided to us via piston_window and gfx, though you may use 38 | // any type that implements `CharacterCache`. 39 | let assets = find_folder::Search::ParentsThenKids(3, 3) 40 | .for_folder("assets").unwrap(); 41 | let font_path = assets.join("fonts/NotoSans/NotoSans-Regular.ttf"); 42 | let glyph_cache = Glyphs::new(&font_path, window.factory.clone()).unwrap(); 43 | Ui::new(glyph_cache, conrod::Theme::default()) 44 | }; 45 | 46 | window.set_ups(60); 47 | 48 | let args: Vec = env::args().collect(); 49 | let path : &str = if args.len() >= 2 { 50 | &args[1] 51 | } else { 52 | "src" 53 | }; 54 | let layout = layout::layout_dir(Path::new(path)); 55 | let mut particle_renderer = particle_renderer::ParticleRenderer::new( 56 | &mut window.factory, window.output_color.clone(), window.window.draw_size(), &layout); 57 | 58 | while let Some(e) = window.next() { 59 | // Pass each `Event` to the `Ui`. 60 | ui.handle_event(&e); 61 | 62 | if let Event::Input(Input::Move(Motion::MouseScroll(x,y))) = e { 63 | particle_renderer.scroll_canvas(x as f32,y as f32); 64 | } 65 | 66 | e.update(|_| ui.set_widgets(|ref mut ui| { 67 | // The `widget_ids` macro is a easy, safe way of generating unique `WidgetId`s. 68 | widget_ids! { 69 | // An ID for the background widget, upon which we'll place our custom button. 70 | // BACKGROUND, 71 | // The WidgetId we'll use to plug our widget into the `Ui`. 72 | ZOOM_IN_BUTTON, 73 | ZOOM_OUT_BUTTON, 74 | } 75 | 76 | // Create an instance of our custom widget. 77 | Button::new() 78 | .color(conrod::color::rgb(0.0, 0.3, 0.1)) 79 | .top_left_with_margins(10.0, 10.0) 80 | .w_h(100.0, 50.0) 81 | .label_color(conrod::color::WHITE) 82 | .label("Zoom in") 83 | .react(|| particle_renderer.zoom(1.5)) 84 | .set(ZOOM_IN_BUTTON, ui); 85 | Button::new() 86 | .color(conrod::color::rgb(0.0, 0.3, 0.1)) 87 | .right(10.0) 88 | .w_h(100.0, 50.0) 89 | .label_color(conrod::color::WHITE) 90 | .label("Zoom out") 91 | .react(|| particle_renderer.zoom(0.66)) 92 | .set(ZOOM_OUT_BUTTON, ui); 93 | })); 94 | 95 | window.draw_3d(&e, |w| particle_renderer.render(&mut w.encoder)); 96 | // Draws the whole Ui (in this case, just our widget) whenever a change occurs. 97 | window.draw_2d(&e, |c, g| ui.draw(c, g)); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /src/particle_renderer.rs: -------------------------------------------------------------------------------- 1 | use gfx; 2 | use cgmath; 3 | use cgmath::{Matrix4, Vector2, SquareMatrix}; 4 | use piston_window::Size; 5 | 6 | const QUAD_VERTICES: [Vertex; 4] = [ 7 | Vertex { position: [-0.5, 0.5] }, 8 | Vertex { position: [-0.5, -0.5] }, 9 | Vertex { position: [ 0.5, -0.5] }, 10 | Vertex { position: [ 0.5, 0.5] }, 11 | ]; 12 | 13 | const QUAD_INDICES: [u16; 6] = [0, 1, 2, 2, 3, 0]; 14 | const INITIAL_SCALE: f32 = 8.0; 15 | 16 | gfx_defines!{ 17 | vertex Vertex { 18 | position: [f32; 2] = "a_Position", 19 | } 20 | 21 | // color format: 0xRRGGBBAA 22 | vertex Instance { 23 | translate: [f32; 2] = "a_Translate", 24 | color: u32 = "a_Color", 25 | } 26 | 27 | constant Locals { 28 | transform: [[f32; 4]; 4] = "u_Transform", 29 | } 30 | 31 | pipeline pipe { 32 | vertex: gfx::VertexBuffer = (), 33 | instance: gfx::InstanceBuffer = (), 34 | locals_cb: gfx::ConstantBuffer = "b_VsLocals", 35 | out: gfx::RenderTarget = "Target0", 36 | } 37 | } 38 | 39 | pub struct ParticleRenderer { 40 | pso: gfx::PipelineState, 41 | data: pipe::Data, 42 | slice: gfx::Slice, 43 | locals: Locals, 44 | 45 | projection: Matrix4, 46 | px_per_unit: f32, 47 | translation: Vector2 48 | } 49 | 50 | impl ParticleRenderer { 51 | pub fn new>(mut factory: &mut F, 52 | color: gfx::handle::RenderTargetView, size: Size, data: &[Instance]) -> Self { 53 | use gfx::traits::FactoryExt; 54 | 55 | let instance_count = data.len() as u32; 56 | println!("{} instances", instance_count); 57 | // assert!(instance_count as usize <= MAX_INSTANCE_COUNT); 58 | 59 | let quad_instances = factory.create_buffer_const(data, gfx::BufferRole::Vertex, gfx::Bind::empty()).unwrap(); 60 | 61 | let (quad_vertices, mut slice) = factory.create_vertex_buffer_with_slice(&QUAD_VERTICES, &QUAD_INDICES[..]); 62 | slice.instances = Some((instance_count, 0)); 63 | 64 | ParticleRenderer { 65 | pso: factory.create_pipeline_simple( 66 | include_bytes!("../shader/instancing_150.glslv"), 67 | include_bytes!("../shader/instancing_150.glslf"), 68 | pipe::new() 69 | ).unwrap(), 70 | data: pipe::Data { 71 | vertex: quad_vertices, 72 | instance: quad_instances, 73 | locals_cb: factory.create_constant_buffer(1), 74 | out: color, 75 | }, 76 | locals: Locals { 77 | transform: Matrix4::identity().into(), 78 | }, 79 | slice: slice, 80 | 81 | px_per_unit: INITIAL_SCALE, 82 | translation: Vector2::new(-((size.width as f32)/2.0/INITIAL_SCALE), (size.height as f32)/2.0/INITIAL_SCALE), 83 | projection: cgmath::ortho(-((size.width as f32)/2.0), (size.width as f32)/2.0, -((size.height as f32)/2.0), (size.height as f32)/2.0, -10.0, 10.0) 84 | } 85 | } 86 | 87 | fn compute_transform(&self) -> Matrix4 { 88 | let scale = Matrix4::from_scale(self.px_per_unit); 89 | let translate = Matrix4::from_translation(self.translation.extend(0.0)); 90 | (self.projection * scale * translate) 91 | } 92 | 93 | pub fn scroll_canvas(&mut self, x: f32, y: f32) { 94 | self.translation = self.translation + Vector2::new(x,-y)*(1.0/self.px_per_unit); 95 | } 96 | 97 | pub fn zoom(&mut self, factor: f32) { 98 | self.px_per_unit *= factor; 99 | } 100 | 101 | pub fn render>(&mut self, encoder: &mut gfx::Encoder) { 102 | self.locals.transform = self.compute_transform().into(); 103 | encoder.update_constant_buffer(&self.data.locals_cb, &self.locals); 104 | encoder.clear(&self.data.out, [0.068, 0.076, 0.092, 1.0]); 105 | encoder.draw(&self.slice, &self.pso, &self.data); 106 | } 107 | } 108 | --------------------------------------------------------------------------------