From d6d50fb445ed204e56f1a991c428825fbc234ad3 Mon Sep 17 00:00:00 2001 From: Piotr Date: Tue, 29 Sep 2020 18:00:11 +0200 Subject: [PATCH] Working build without input --- Cargo.lock | 792 +++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 5 +- src/example_client.rs | 6 +- src/gaia/client.rs | 3 +- src/gaia/engine.rs | 158 ++++++--- src/main.rs | 3 +- 6 files changed, 905 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6d6cff..b62e2b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,31 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "andrew" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" +dependencies = [ + "bitflags", + "line_drawing", + "rusttype 0.7.9", + "walkdir", + "xdg", + "xml-rs 0.8.3", +] + +[[package]] +name = "android_glue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" + +[[package]] +name = "android_log-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" + [[package]] name = "approx" version = "0.3.2" @@ -27,6 +53,29 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "calloop" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" +dependencies = [ + "mio", + "mio-extras", + "nix", +] + [[package]] name = "cc" version = "1.0.58" @@ -39,6 +88,15 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cgl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" +dependencies = [ + "libc", +] + [[package]] name = "cgmath" version = "0.17.0" @@ -68,6 +126,62 @@ dependencies = [ "cc", ] +[[package]] +name = "cocoa" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" +dependencies = [ + "bitflags", + "block", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" + +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" +dependencies = [ + "bitflags", + "core-foundation", + "foreign-types", + "libc", +] + +[[package]] +name = "core-video-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" +dependencies = [ + "cfg-if", + "core-foundation-sys", + "core-graphics", + "libc", + "objc", +] + [[package]] name = "darling" version = "0.10.2" @@ -86,8 +200,8 @@ checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" dependencies = [ "fnv", "ident_case", - "proc-macro2", - "quote", + "proc-macro2 1.0.19", + "quote 1.0.7", "strsim", "syn", ] @@ -99,10 +213,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core", - "quote", + "quote 1.0.7", "syn", ] +[[package]] +name = "derivative" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +dependencies = [ + "proc-macro2 1.0.19", + "quote 1.0.7", + "syn", +] + +[[package]] +name = "dispatch" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" + +[[package]] +name = "dlib" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" +dependencies = [ + "libloading 0.6.3", +] + [[package]] name = "doppler" version = "0.1.0" @@ -110,6 +250,7 @@ dependencies = [ "cgmath", "gl", "glfw", + "glutin", "image2", "imgui-glfw-rs", "imgui-inspect", @@ -120,18 +261,55 @@ dependencies = [ "tobj", ] +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "fuchsia-cprng" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + [[package]] name = "gl" version = "0.14.0" @@ -175,7 +353,7 @@ dependencies = [ "objc", "raw-window-handle", "semver", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -187,6 +365,78 @@ dependencies = [ "cmake", ] +[[package]] +name = "glutin" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9666c8fd9afd008f6559e2468c35e11aad1d110d525bb3b354e4138ec0e20f" +dependencies = [ + "android_glue", + "cgl", + "cocoa", + "core-foundation", + "core-graphics", + "glutin_egl_sys", + "glutin_emscripten_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "lazy_static", + "libloading 0.5.2", + "log", + "objc", + "osmesa-sys", + "parking_lot", + "wayland-client", + "winapi 0.3.9", + "winit", +] + +[[package]] +name = "glutin_egl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" +dependencies = [ + "gl_generator 0.14.0", + "winapi 0.3.9", +] + +[[package]] +name = "glutin_emscripten_sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80de4146df76e8a6c32b03007bc764ff3249dcaeb4f675d68a06caf1bac363f1" + +[[package]] +name = "glutin_gles2_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +dependencies = [ + "gl_generator 0.14.0", + "objc", +] + +[[package]] +name = "glutin_glx_sys" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" +dependencies = [ + "gl_generator 0.14.0", + "x11-dl", +] + +[[package]] +name = "glutin_wgl_sys" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +dependencies = [ + "gl_generator 0.14.0", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -242,8 +492,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd0654249213b6df7aed82a4a1dd41d6e11533fa5a7a4b5ac0b282107d7cf73d" dependencies = [ "darling", - "proc-macro2", - "quote", + "proc-macro2 1.0.19", + "quote 1.0.7", "syn", ] @@ -275,6 +525,40 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "instant" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "khronos_api" version = "2.2.0" @@ -293,12 +577,47 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10" +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi 0.3.9", +] + +[[package]] +name = "libloading" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2443d8f0478b16759158b2f66d525991a05491138bc05814ef52a250148ef4f9" +dependencies = [ + "cfg-if", + "winapi 0.3.9", +] + +[[package]] +name = "line_drawing" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" +dependencies = [ + "num-traits", +] + [[package]] name = "lock_api" version = "0.3.4" @@ -326,6 +645,120 @@ dependencies = [ "libc", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memmap" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +dependencies = [ + "cfg-if", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "ndk" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" +dependencies = [ + "jni-sys", + "ndk-sys", + "num_enum", +] + +[[package]] +name = "ndk-glue" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" +dependencies = [ + "android_log-sys", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-sys", +] + +[[package]] +name = "ndk-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" + +[[package]] +name = "net2" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +dependencies = [ + "cfg-if", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "nix" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +dependencies = [ + "bitflags", + "cc", + "cfg-if", + "libc", + "void", +] + [[package]] name = "num" version = "0.3.0" @@ -402,6 +835,28 @@ dependencies = [ "autocfg 1.0.0", ] +[[package]] +name = "num_enum" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca565a7df06f3d4b485494f25ba05da1435950f4dc263440eda7a6fa9b8e36e4" +dependencies = [ + "derivative", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" +dependencies = [ + "proc-macro-crate", + "proc-macro2 1.0.19", + "quote 1.0.7", + "syn", +] + [[package]] name = "objc" version = "0.2.7" @@ -411,6 +866,24 @@ dependencies = [ "malloc_buf", ] +[[package]] +name = "ordered-float" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" +dependencies = [ + "num-traits", +] + +[[package]] +name = "osmesa-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" +dependencies = [ + "shared_library", +] + [[package]] name = "parking_lot" version = "0.10.2" @@ -432,7 +905,37 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pkg-config" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +dependencies = [ + "unicode-xid 0.1.0", ] [[package]] @@ -441,7 +944,16 @@ version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12" dependencies = [ - "unicode-xid", + "unicode-xid 0.2.1", +] + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +dependencies = [ + "proc-macro2 0.4.30", ] [[package]] @@ -450,7 +962,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2", + "proc-macro2 1.0.19", ] [[package]] @@ -469,7 +981,7 @@ dependencies = [ "rand_os", "rand_pcg", "rand_xorshift", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -523,7 +1035,7 @@ checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ "libc", "rand_core 0.4.2", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -537,7 +1049,7 @@ dependencies = [ "libc", "rand_core 0.4.2", "rdrand", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -583,6 +1095,35 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +[[package]] +name = "rusttype" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +dependencies = [ + "rusttype 0.8.3", +] + +[[package]] +name = "rusttype" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" +dependencies = [ + "approx", + "ordered-float", + "stb_truetype", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -604,6 +1145,22 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "serde" +version = "1.0.116" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" + +[[package]] +name = "shared_library" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" +dependencies = [ + "lazy_static", + "libc", +] + [[package]] name = "simple-logging" version = "2.0.2" @@ -615,12 +1172,43 @@ dependencies = [ "thread-id", ] +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" + [[package]] name = "smallvec" version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +[[package]] +name = "smithay-client-toolkit" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" +dependencies = [ + "andrew", + "bitflags", + "dlib", + "lazy_static", + "memmap", + "nix", + "wayland-client", + "wayland-protocols", +] + +[[package]] +name = "stb_truetype" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" +dependencies = [ + "byteorder", +] + [[package]] name = "strsim" version = "0.9.3" @@ -633,9 +1221,9 @@ version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4" dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", + "proc-macro2 1.0.19", + "quote 1.0.7", + "unicode-xid 0.2.1", ] [[package]] @@ -646,7 +1234,7 @@ checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" dependencies = [ "libc", "redox_syscall", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -655,12 +1243,110 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6172100cd5b17cdd085c94f261e31101ca31886c86a2337a6687dac6d2fb3cf1" +[[package]] +name = "toml" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +dependencies = [ + "serde", +] + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" + [[package]] name = "unicode-xid" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +dependencies = [ + "same-file", + "winapi 0.3.9", + "winapi-util", +] + +[[package]] +name = "wayland-client" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" +dependencies = [ + "bitflags", + "calloop", + "downcast-rs", + "libc", + "mio", + "nix", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" +dependencies = [ + "nix", + "wayland-sys", +] + +[[package]] +name = "wayland-protocols" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +dependencies = [ + "bitflags", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "xml-rs 0.8.3", +] + +[[package]] +name = "wayland-sys" +version = "0.23.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +dependencies = [ + "dlib", + "lazy_static", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -671,18 +1357,92 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winit" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" +dependencies = [ + "bitflags", + "cocoa", + "core-foundation", + "core-graphics", + "core-video-sys", + "dispatch", + "instant", + "lazy_static", + "libc", + "log", + "mio", + "mio-extras", + "ndk", + "ndk-glue", + "ndk-sys", + "objc", + "parking_lot", + "percent-encoding", + "raw-window-handle", + "smithay-client-toolkit", + "wayland-client", + "winapi 0.3.9", + "x11-dl", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "x11-dl" +version = "2.18.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" +dependencies = [ + "lazy_static", + "libc", + "maybe-uninit", + "pkg-config", +] + +[[package]] +name = "xdg" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" + [[package]] name = "xml-rs" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index 00ddcae..762f98e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,11 +21,12 @@ inline_tweak = "1.0.8" log = "0.4.11" simple-logging = "2.0.2" image2 = { git = "https://github.com/Leinnan/image2-rs", branch="legacy", default-features = false, features=["io"] } +glutin = "0.24.1" [features] -default = ["imgui_inspect"] +default = [] imgui_inspect = ["imgui-inspect-derive", "imgui-inspect", "imgui-glfw-rs"] -no_imgui = ["glfw"] +glfw_obsolete = ["glfw"] [profile.dev.package."*"] opt-level = 2 \ No newline at end of file diff --git a/src/example_client.rs b/src/example_client.rs index d2f0d73..4498521 100644 --- a/src/example_client.rs +++ b/src/example_client.rs @@ -9,7 +9,7 @@ use crate::gaia::sky::Sky; use crate::gaia::*; use cgmath::prelude::*; use cgmath::{perspective, vec3, Deg, Matrix4, Point3, Vector3}; -#[cfg(feature = "no_imgui")] +#[cfg(feature = "glfw_obsolete")] use glfw; #[cfg(feature = "imgui_inspect")] use imgui_glfw_rs::glfw; @@ -27,7 +27,7 @@ pub struct ExampleClient { } impl ExampleClient { - pub fn create(_window: &glfw::Window) -> ExampleClient { + pub fn create() -> ExampleClient { let sky = unsafe { Sky::new() }; ExampleClient { models: vec![], @@ -128,6 +128,8 @@ impl Client for ExampleClient { } fn update(&mut self, _engine: &mut Engine) {} + + #[cfg(feature="glfw_obsolete")] fn process_input(&mut self, window: &glfw::Window, delta: f32) { use glfw::{Action, Key}; if window.get_key(Key::W) == Action::Press { diff --git a/src/gaia/client.rs b/src/gaia/client.rs index 994c859..e0e077e 100644 --- a/src/gaia/client.rs +++ b/src/gaia/client.rs @@ -1,6 +1,6 @@ use crate::gaia::assets_cache::AssetsCache; use crate::gaia::engine::Engine; -#[cfg(feature = "no_imgui")] +#[cfg(feature = "glfw_obsolete")] use glfw; #[cfg(feature = "imgui_inspect")] use imgui_glfw_rs::glfw; @@ -8,6 +8,7 @@ use imgui_glfw_rs::glfw; pub trait Client { fn load_assets(&mut self, cache: &mut AssetsCache); fn update(&mut self, engine: &mut Engine); + #[cfg(feature="glfw_obsolete")] fn process_input(&mut self, window: &glfw::Window, delta: f32); fn on_mouse_scroll(&mut self, yoffset: f32); fn on_mouse_move(&mut self, x: f32, y: f32); diff --git a/src/gaia/engine.rs b/src/gaia/engine.rs index de3873f..d816b93 100644 --- a/src/gaia/engine.rs +++ b/src/gaia/engine.rs @@ -5,7 +5,7 @@ use crate::gaia::client::Client; use crate::gaia::consts; use crate::gaia::framebuffer::FramebufferSystem; use cgmath::Point3; -#[cfg(feature = "no_imgui")] +#[cfg(feature = "glfw_obsolete")] use glfw; #[cfg(feature = "imgui_inspect")] use imgui_glfw_rs::glfw; @@ -14,15 +14,95 @@ use imgui_glfw_rs::imgui; #[cfg(feature = "imgui_inspect")] use imgui_glfw_rs::ImguiGLFW; -use glfw::{Action, Context, Key}; use log::{info, trace, warn}; +#[cfg(not(feature="glfw_obsolete"))] +pub struct Engine { + title: String, + size: (i32,i32), + debug_layer: bool, +} + +#[cfg(not(feature="glfw_obsolete"))] +impl Default for Engine { + fn default() -> Self { + Engine{ + title: String::from("Doppler demo"), + size: (1280, 720), + debug_layer: false, + } + } +} + +#[cfg(not(feature="glfw_obsolete"))] +impl Engine { + pub fn run(&self) { + let event_loop = glutin::event_loop::EventLoop::new(); + let window = glutin::window::WindowBuilder::new().with_title(&self.title) + .with_inner_size(glutin::dpi::LogicalSize::new(self.size.0 as f32, self.size.1 as f32)); + let gl_window = glutin::ContextBuilder::new() + .build_windowed(window, &event_loop) + .unwrap(); + + let gl_window = unsafe { gl_window.make_current().unwrap() }; + gl::load_with(|symbol| gl_window.get_proc_address(symbol)); + // configure global opengl state + // ----------------------------- + unsafe { + gl::Enable(gl::DEPTH_TEST); + } + let mut client = ExampleClient::create(); + let mut framebuffer = unsafe { FramebufferSystem::generate(1024, 768) }; + let mut camera = Camera { + position: Point3::new(0.0, 0.0, 3.0), + ..Camera::default() + }; + let mut assets_cache = AssetsCache::default(); + client.load_assets(&mut assets_cache); + let mut first_mouse = true; + let mut last_x: f32 = consts::SCR_WIDTH as f32 / 2.0; + let mut last_y: f32 = consts::SCR_HEIGHT as f32 / 2.0; + + // timing + let mut delta_time: f32; // time between current frame and last frame + let mut last_frame: f32 = 0.0; + + + event_loop.run(move |event, _, control_flow| { + use glutin::event::{Event, WindowEvent}; + use glutin::event_loop::ControlFlow; + *control_flow = ControlFlow::Poll; + match event { + Event::LoopDestroyed => return, + Event::WindowEvent { event, .. } => match event { + WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit, + WindowEvent::Resized(size) => { + info!("Resizing!"); + unsafe { gl::Viewport(0, 0, size.width as i32, size.height as i32) } + let window_size = (size.width as f32, size.height as f32); + framebuffer = unsafe { FramebufferSystem::generate(size.width as i32, size.height as i32) }; + }, + _ => (), + }, + Event::RedrawRequested(_) => { + unsafe { + framebuffer.clear(); + client.draw(); + framebuffer.draw(); + } + gl_window.swap_buffers().unwrap(); + }, + _ => (), + } + }); + } +} + +#[cfg(feature="glfw_obsolete")] pub struct Engine { pub camera: Camera, - pub window: glfw::Window, + pub ctx_wrapper: glutin::ContextWrapper, pub window_size: (f32, f32), - pub events: std::sync::mpsc::Receiver<(f64, glfw::WindowEvent)>, - pub glfw: glfw::Glfw, #[cfg(feature = "imgui_inspect")] pub imgui: imgui::Context, #[cfg(feature = "imgui_inspect")] @@ -33,6 +113,7 @@ pub struct Engine { framebuffer: FramebufferSystem, } +#[cfg(feature="glfw_obsolete")] impl Engine { pub fn run(&mut self) { self.client.load_assets(&mut self.assets_cache); @@ -57,7 +138,7 @@ impl Engine { #[cfg(feature = "imgui_inspect")] let skip_input = self.imgui.io().want_capture_mouse || self.imgui.io().want_capture_keyboard; - #[cfg(feature = "no_imgui")] + #[cfg(not(feature = "imgui_inspect"))] let skip_input = false; if !skip_input { self.process_input(delta_time); @@ -202,40 +283,41 @@ impl Engine { } } +#[cfg(feature="glfw_obsolete")] impl Default for Engine { fn default() -> Self { - // glfw: initialize and configure - // ------------------------------ - let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap(); - glfw.window_hint(glfw::WindowHint::ContextVersion(3, 3)); - glfw.window_hint(glfw::WindowHint::OpenGlProfile( - glfw::OpenGlProfileHint::Core, - )); - #[cfg(target_os = "macos")] - glfw.window_hint(glfw::WindowHint::OpenGlForwardCompat(true)); + // // glfw: initialize and configure + // // ------------------------------ + // let mut glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap(); + // glfw.window_hint(glfw::WindowHint::ContextVersion(3, 3)); + // glfw.window_hint(glfw::WindowHint::OpenGlProfile( + // glfw::OpenGlProfileHint::Core, + // )); + // #[cfg(target_os = "macos")] + // glfw.window_hint(glfw::WindowHint::OpenGlForwardCompat(true)); // glfw window creation // -------------------- - let (mut window, events) = glfw - .create_window( - consts::SCR_WIDTH, - consts::SCR_HEIGHT, - "chRustedGL", - glfw::WindowMode::Windowed, - ) - .expect("Failed to create GLFW window"); + // let (mut window, events) = glfw + // .create_window( + // consts::SCR_WIDTH, + // consts::SCR_HEIGHT, + // "chRustedGL", + // glfw::WindowMode::Windowed, + // ) + // .expect("Failed to create GLFW window"); - window.make_current(); - window.set_all_polling(true); - window.set_framebuffer_size_polling(true); - window.set_cursor_pos_polling(true); - window.set_scroll_polling(true); + // window.make_current(); + // window.set_all_polling(true); + // window.set_framebuffer_size_polling(true); + // window.set_cursor_pos_polling(true); + // window.set_scroll_polling(true); - // tell GLFW to capture our mouse - window.set_cursor_mode(glfw::CursorMode::Disabled); - // gl: load all OpenGL function pointers - // --------------------------------------- - gl::load_with(|symbol| window.get_proc_address(symbol) as *const _); + // // tell GLFW to capture our mouse + // window.set_cursor_mode(glfw::CursorMode::Disabled); + // // gl: load all OpenGL function pointers + // // --------------------------------------- + // gl::load_with(|symbol| window.get_proc_address(symbol) as *const _); #[cfg(feature = "imgui_inspect")] let mut imgui = imgui::Context::create(); @@ -311,15 +393,13 @@ impl Default for Engine { unsafe { gl::Enable(gl::DEPTH_TEST); } - let client = ExampleClient::create(&window); - let (scr_width, scr_height) = window.get_framebuffer_size(); - let fb = unsafe { FramebufferSystem::generate(scr_width, scr_height) }; + let client = ExampleClient::create(); + let fb = unsafe { FramebufferSystem::generate(1024, 768) }; Engine { - window: window, + ctx_wrapper: gl_window, window_size: (consts::SCR_WIDTH as f32, consts::SCR_HEIGHT as f32), - events: events, - glfw: glfw, + events: event_loop, #[cfg(feature = "imgui_inspect")] imgui: imgui, #[cfg(feature = "imgui_inspect")] diff --git a/src/main.rs b/src/main.rs index 9faf00d..63591c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] extern crate gl; +extern crate glutin; #[cfg(feature = "imgui_inspect")] extern crate imgui_glfw_rs; @@ -12,12 +13,10 @@ mod gaia; mod example_client; use crate::gaia::engine::Engine; -// use human_panic::setup_panic; use log::LevelFilter; use log::{info, trace, warn}; pub fn main() { - // setup_panic!(); simple_logging::log_to_file("log.log", LevelFilter::Info); info!("Starting engine!"); let mut engine = Engine::default();