diff --git a/.gitignore b/.gitignore index 9375c42..85bce9d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ **jpg **jpeg imgui.ini -log.log \ No newline at end of file +log.log +/doppler/target \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ef70b42..d1bcdc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,6 +253,18 @@ dependencies = [ "tobj", ] +[[package]] +name = "doppler_example" +version = "0.1.0" +dependencies = [ + "cgmath", + "doppler", + "glutin", + "imgui", + "imgui-inspect", + "imgui-inspect-derive", +] + [[package]] name = "downcast-rs" version = "1.2.0" diff --git a/Cargo.toml b/Cargo.toml index 9036107..d53ac6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "doppler" +name = "doppler_example" version = "0.1.0" authors = ["Piotr "] edition = "2018" @@ -10,23 +10,12 @@ panic = 'abort' lto = true [dependencies] -gl = "0.14.0" -imgui="0.4" -imgui-winit-support = {version="0.4.0", optional=true} -imgui-opengl-renderer = {version="0.8", optional = true} -cgmath = "0.17.0" -imgui-inspect = {version="0.5.0", optional = true} -imgui-inspect-derive = {version="0.5.0", optional= true} -tobj = "2.0.2" -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"] } +doppler = {path="doppler"} glutin = "0.24.1" - -[features] -default = ["imgui_inspect"] -imgui_inspect = ["imgui-inspect-derive","imgui-opengl-renderer", "imgui-inspect", "imgui-winit-support"] +cgmath = "0.17.0" +imgui="0.4.0" +imgui-inspect = "0.5.0" +imgui-inspect-derive = "0.5.0" [profile.dev.package."*"] opt-level = 2 \ No newline at end of file diff --git a/doppler/Cargo.lock b/doppler/Cargo.lock new file mode 100644 index 0000000..2d2944c --- /dev/null +++ b/doppler/Cargo.lock @@ -0,0 +1,1411 @@ +# 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" +dependencies = [ + "num-traits", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +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.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" + +[[package]] +name = "cfg-if" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "283944cdecc44bf0b8dd010ec9af888d3b4f142844fdbe026c20ef68148d6fe7" +dependencies = [ + "approx", + "num-traits", + "rand", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2 1.0.23", + "quote 1.0.7", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "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.23", + "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 = "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 = "gaia" +version = "0.1.0" +dependencies = [ + "cgmath", + "gl", + "glutin", + "image2", + "imgui", + "imgui-inspect", + "imgui-inspect-derive", + "imgui-opengl-renderer", + "imgui-winit-support", + "inline_tweak", + "log", + "simple-logging", + "tobj", +] + +[[package]] +name = "gl" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a94edab108827d67608095e269cf862e60d920f144a5026d3dbcfd8b877fb404" +dependencies = [ + "gl_generator 0.14.0", +] + +[[package]] +name = "gl_generator" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" +dependencies = [ + "khronos_api 2.2.0", + "log", + "xml-rs 0.7.0", +] + +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api 3.1.0", + "log", + "xml-rs 0.8.3", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "image2" +version = "0.11.4" +source = "git+https://github.com/Leinnan/image2-rs?branch=legacy#ed21bc2a18f2e0ec5c7a5d9f9b4fc52e4c7d7d7e" +dependencies = [ + "cc", + "num", +] + +[[package]] +name = "imgui" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fdb2bcc7e498e78137ce28705ae836d69e36ee2eac89d0d926cfabfcf550570" +dependencies = [ + "bitflags", + "imgui-sys", + "lazy_static", + "parking_lot", +] + +[[package]] +name = "imgui-inspect" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df7314937ce7b2ca5ec374bdb0bd9f1f398d7648d658ae298136b2b66f9b14d0" +dependencies = [ + "imgui", + "imgui-inspect-derive", +] + +[[package]] +name = "imgui-inspect-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd0654249213b6df7aed82a4a1dd41d6e11533fa5a7a4b5ac0b282107d7cf73d" +dependencies = [ + "darling", + "proc-macro2 1.0.23", + "quote 1.0.7", + "syn", +] + +[[package]] +name = "imgui-opengl-renderer" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "610bc2facbf1fe9bcf24bf6d299fada80ad1fc86283bac986b5cfc258e971e56" +dependencies = [ + "gl_generator 0.9.0", + "imgui", +] + +[[package]] +name = "imgui-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72be9671d64dd0ed26bb708cd10060a431262ac90ae70cf7c5912feefe6849da" +dependencies = [ + "cc", +] + +[[package]] +name = "imgui-winit-support" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98171c35263e3eb0dfb66cb876e3efdb788d777c1b613c7d2592303d1276bb5" +dependencies = [ + "imgui", + "winit", +] + +[[package]] +name = "inline_tweak" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7033e97b20277cc0d043226d1940fa7719ff08d2305d1fc7421e53066d00eb4b" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554" + +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + +[[package]] +name = "lazy_static" +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.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3e176191bc4faad357e3122c4747aa098ac880e88b168f106386128736cf4a" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f3fc75e3697059fb1bc465e3d8cca6cf92f56854f201158b3f9c77d5a3cfa0" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05ad05bd8977050b171b3f6b48175fea6e0565b7981059b486075e1026a9fb5" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +dependencies = [ + "autocfg 1.0.1", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" +dependencies = [ + "autocfg 1.0.1", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b4d7360f362cfb50dde8143501e6940b22f644be75a4cc90b2d81968908138" +dependencies = [ + "autocfg 1.0.1", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +dependencies = [ + "autocfg 1.0.1", +] + +[[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.23", + "quote 1.0.7", + "syn", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +dependencies = [ + "cfg-if", + "cloudabi", + "libc", + "redox_syscall", + "smallvec", + "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]] +name = "proc-macro2" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ef7cd2518ead700af67bf9d1a658d90b6037d77110fd9c0445429d0ba1c6c9" +dependencies = [ + "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]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +dependencies = [ + "proc-macro2 1.0.23", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc", + "rand_chacha", + "rand_core 0.4.2", + "rand_hc", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi 0.3.9", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi 0.3.9", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" +dependencies = [ + "libc", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00d48e85675326bb182a2286ea7c1a0b264333ae10f27a937a72be08628b542" +dependencies = [ + "lazy_static", + "log", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "syn" +version = "1.0.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228" +dependencies = [ + "proc-macro2 1.0.23", + "quote 1.0.7", + "unicode-xid 0.2.1", +] + +[[package]] +name = "thread-id" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" +dependencies = [ + "libc", + "redox_syscall", + "winapi 0.3.9", +] + +[[package]] +name = "tobj" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" +dependencies = [ + "bitflags", +] + +[[package]] +name = "xml-rs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" diff --git a/doppler/Cargo.toml b/doppler/Cargo.toml new file mode 100644 index 0000000..e274ed6 --- /dev/null +++ b/doppler/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "doppler" +version = "0.1.0" +authors = ["Piotr "] +edition = "2018" + +[dependencies] +gl = "0.14.0" +imgui={version="0.4.0", optional=true} +imgui-winit-support = {version="0.4.0", optional=true} +imgui-opengl-renderer = {version="0.8", optional = true} +cgmath = "0.17.0" +imgui-inspect = {version="0.5.0", optional = true} +imgui-inspect-derive = {version="0.5.0", optional= true} +tobj = "2.0.2" +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"] +imgui_inspect = ["imgui","imgui-inspect-derive","imgui-opengl-renderer", "imgui-inspect", "imgui-winit-support"] + diff --git a/doppler/resources/FiraSans-SemiBold.ttf b/doppler/resources/FiraSans-SemiBold.ttf new file mode 100644 index 0000000..821a43d Binary files /dev/null and b/doppler/resources/FiraSans-SemiBold.ttf differ diff --git a/doppler/resources/shaders/framebuffers_screen.fs b/doppler/resources/shaders/framebuffers_screen.fs new file mode 100644 index 0000000..7cb267e --- /dev/null +++ b/doppler/resources/shaders/framebuffers_screen.fs @@ -0,0 +1,28 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +uniform float screen_width; +uniform float screen_height; +uniform sampler2D screenTexture; + +uniform float pixelWidth = 3.0; +uniform float pixelHeight = 3.0; + +void main() +{ + vec2 uv = TexCoords.xy; + uv *= 1.0 - uv.yx; + float vig = uv.x*uv.y * 15.0; + vig = pow(vig, 0.3); + + float dx = pixelWidth*(1.0/screen_width); + float dy = pixelHeight*(1.0/screen_height); + + vec2 coord = vec2(dx*floor(TexCoords.x/dx), dy*floor(TexCoords.y/dy)); + + vec3 tc = texture(screenTexture, coord).rgb; + + FragColor = vec4(tc,1.0) * vig; +} diff --git a/doppler/resources/shaders/framebuffers_screen.vs b/doppler/resources/shaders/framebuffers_screen.vs new file mode 100644 index 0000000..2a6ddb5 --- /dev/null +++ b/doppler/resources/shaders/framebuffers_screen.vs @@ -0,0 +1,11 @@ +#version 330 core +layout (location = 0) in vec2 aPos; +layout (location = 1) in vec2 aTexCoords; + +out vec2 TexCoords; + +void main() +{ + TexCoords = aTexCoords; + gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0); +} diff --git a/doppler/resources/shaders/lamp.fs b/doppler/resources/shaders/lamp.fs new file mode 100644 index 0000000..36ec83a --- /dev/null +++ b/doppler/resources/shaders/lamp.fs @@ -0,0 +1,7 @@ +#version 330 core +out vec4 FragColor; + +void main() +{ + FragColor = vec4(1.0); // set alle 4 vector values to 1.0 +} diff --git a/doppler/resources/shaders/lamp.vs b/doppler/resources/shaders/lamp.vs new file mode 100644 index 0000000..70a22c7 --- /dev/null +++ b/doppler/resources/shaders/lamp.vs @@ -0,0 +1,11 @@ +#version 330 core +layout (location = 0) in vec3 aPos; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +void main() +{ + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/doppler/resources/shaders/model_loading.fs b/doppler/resources/shaders/model_loading.fs new file mode 100644 index 0000000..a5b3540 --- /dev/null +++ b/doppler/resources/shaders/model_loading.fs @@ -0,0 +1,14 @@ +#version 330 core +out vec4 FragColor; + +in vec2 TexCoords; + +uniform sampler2D texture_diffuse1; + +void main() +{ + vec4 texColor = texture(texture_diffuse1, TexCoords); + if(texColor.a < 0.1) + discard; + FragColor = texColor; +} diff --git a/doppler/resources/shaders/model_loading.vs b/doppler/resources/shaders/model_loading.vs new file mode 100644 index 0000000..ed5332c --- /dev/null +++ b/doppler/resources/shaders/model_loading.vs @@ -0,0 +1,16 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +out vec2 TexCoords; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 projection; + +void main() +{ + TexCoords = aTexCoords; + gl_Position = projection * view * model * vec4(aPos, 1.0); +} diff --git a/doppler/resources/shaders/multiple_lights.fs b/doppler/resources/shaders/multiple_lights.fs new file mode 100644 index 0000000..d3eac9f --- /dev/null +++ b/doppler/resources/shaders/multiple_lights.fs @@ -0,0 +1,150 @@ +#version 330 core +out vec4 FragColor; + +struct Material { + sampler2D diffuse; + sampler2D specular; + float shininess; +}; + +struct DirLight { + vec3 direction; + + vec3 ambient; + vec3 diffuse; + vec3 specular; +}; + +struct PointLight { + vec3 position; + + float constant; + float linear; + float quadratic; + + vec3 ambient; + vec3 diffuse; + vec3 specular; +}; + +struct SpotLight { + vec3 position; + vec3 direction; + float cutOff; + float outerCutOff; + + float constant; + float linear; + float quadratic; + + vec3 ambient; + vec3 diffuse; + vec3 specular; +}; + +#define NR_POINT_LIGHTS 4 + +in vec3 FragPos; +in vec3 Normal; +in vec2 TexCoords; + +uniform vec3 viewPos; +uniform DirLight dirLight; +uniform PointLight pointLights[NR_POINT_LIGHTS]; +uniform SpotLight spotLight; +uniform Material material; + +// function prototypes +vec3 CalcDirLight(DirLight light, vec3 normal, vec3 viewDir); +vec3 CalcPointLight(PointLight light, vec3 normal, vec3 fragPos, vec3 viewDir); +vec3 CalcSpotLight(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir); + +void main() +{ + vec4 texColor = texture(material.diffuse, TexCoords); + if(texColor.a < 0.1) + discard; + // properties + vec3 norm = normalize(Normal); + vec3 viewDir = normalize(viewPos - FragPos); + + // == ===================================================== + // Our lighting is set up in 3 phases: directional, point lights and an optional flashlight + // For each phase, a calculate function is defined that calculates the corresponding color + // per lamp. In the main() function we take all the calculated colors and sum them up for + // this fragment's final color. + // == ===================================================== + // phase 1: directional lighting + vec3 result = CalcDirLight(dirLight, norm, viewDir); + // phase 2: point lights + for(int i = 0; i < NR_POINT_LIGHTS; i++) + result += CalcPointLight(pointLights[i], norm, FragPos, viewDir); + // phase 3: spot light + //result += CalcSpotLight(spotLight, norm, FragPos, viewDir); + + FragColor = vec4(result, 1.0); +} + +// calculates the color when using a directional light. +vec3 CalcDirLight(DirLight light, vec3 normal, vec3 viewDir) +{ + vec3 lightDir = normalize(-light.direction); + // diffuse shading + float diff = max(dot(normal, lightDir), 0.0); + // specular shading + vec3 reflectDir = reflect(-lightDir, normal); + float spec = pow(max(dot(viewDir, reflectDir), 0.0), material.shininess); + // combine results + vec3 ambient = light.ambient * vec3(texture(material.diffuse, TexCoords)); + vec3 diffuse = light.diffuse * diff * vec3(texture(material.diffuse, TexCoords)); + vec3 specular = light.specular * spec * vec3(texture(material.specular, TexCoords)); + return (ambient + diffuse + specular); +} + +// calculates the color when using a point light. +vec3 CalcPointLight(PointLight light, vec3 normal, vec3 fragPos, vec3 viewDir) +{ + vec3 lightDir = normalize(light.position - fragPos); + // diffuse shading + float diff = max(dot(normal, lightDir), 0.0); + // specular shading + vec3 reflectDir = reflect(-lightDir, normal); + float spec = pow(max(dot(viewDir, reflectDir), 0.0), material.shininess); + // attenuation + float distance = length(light.position - fragPos); + float attenuation = 1.0 / (light.constant + light.linear * distance + light.quadratic * (distance * distance)); + // combine results + vec3 ambient = light.ambient * vec3(texture(material.diffuse, TexCoords)); + vec3 diffuse = light.diffuse * diff * vec3(texture(material.diffuse, TexCoords)); + vec3 specular = light.specular * spec * vec3(texture(material.specular, TexCoords)); + ambient *= attenuation; + diffuse *= attenuation; + specular *= attenuation; + return (ambient + diffuse + specular); +} + +// calculates the color when using a spot light. +vec3 CalcSpotLight(SpotLight light, vec3 normal, vec3 fragPos, vec3 viewDir) +{ + vec3 lightDir = normalize(light.position - fragPos); + // diffuse shading + float diff = max(dot(normal, lightDir), 0.0); + // specular shading + vec3 reflectDir = reflect(-lightDir, normal); + float spec = pow(max(dot(viewDir, reflectDir), 0.0), material.shininess); + // attenuation + float distance = length(light.position - fragPos); + float attenuation = 1.0 / (light.constant + light.linear * distance + light.quadratic * (distance * distance)); + // spotlight intensity + float theta = dot(lightDir, normalize(-light.direction)); + float epsilon = light.cutOff - light.outerCutOff; + float intensity = clamp((theta - light.outerCutOff) / epsilon, 0.0, 1.0); + // combine results + vec3 ambient = light.ambient * vec3(texture(material.diffuse, TexCoords)); + vec3 diffuse = light.diffuse * diff * vec3(texture(material.diffuse, TexCoords)); + vec3 specular = light.specular * spec * vec3(texture(material.specular, TexCoords)); + ambient *= attenuation * intensity; + diffuse *= attenuation * intensity; + specular *= attenuation * intensity; + return (ambient + diffuse + specular); +} diff --git a/doppler/resources/shaders/multiple_lights.vs b/doppler/resources/shaders/multiple_lights.vs new file mode 100644 index 0000000..92a9c30 --- /dev/null +++ b/doppler/resources/shaders/multiple_lights.vs @@ -0,0 +1,30 @@ +#version 330 core +layout (location = 0) in vec3 aPos; +layout (location = 1) in vec3 aNormal; +layout (location = 2) in vec2 aTexCoords; + +#define PRECISION 0.01 +#define MIN_DIST 20.0 + +out vec3 FragPos; +out vec3 Normal; +out vec2 TexCoords; + +uniform mat4 model; +uniform mat4 view; +uniform vec3 viewPos; +uniform mat4 projection; + +void main() +{ + FragPos = vec3(model * vec4(aPos, 1.0)); + Normal = mat3(transpose(inverse(model))) * aNormal; + TexCoords = aTexCoords; + + + gl_Position = projection * view * vec4(FragPos, 1.0); + + if(distance(viewPos, gl_Position.xyz) > MIN_DIST){ + gl_Position.xyz = gl_Position.xyz - mod(gl_Position.xyz, PRECISION); + } +} diff --git a/doppler/resources/shaders/skybox.fs b/doppler/resources/shaders/skybox.fs new file mode 100644 index 0000000..2205847 --- /dev/null +++ b/doppler/resources/shaders/skybox.fs @@ -0,0 +1,11 @@ +#version 330 core +out vec4 FragColor; + +in vec3 TexCoords; + +uniform samplerCube skybox; + +void main() +{ + FragColor = texture(skybox, TexCoords); +} diff --git a/doppler/resources/shaders/skybox.vs b/doppler/resources/shaders/skybox.vs new file mode 100644 index 0000000..f3e48d6 --- /dev/null +++ b/doppler/resources/shaders/skybox.vs @@ -0,0 +1,14 @@ +#version 330 core +layout (location = 0) in vec3 aPos; + +out vec3 TexCoords; + +uniform mat4 projection; +uniform mat4 view; + +void main() +{ + TexCoords = aPos; + vec4 pos = projection * view * vec4(aPos, 1.0); + gl_Position = pos.xyww; +} diff --git a/src/gaia/assets_cache.rs b/doppler/src/assets_cache.rs similarity index 93% rename from src/gaia/assets_cache.rs rename to doppler/src/assets_cache.rs index 53851c3..4dbe5ff 100644 --- a/src/gaia/assets_cache.rs +++ b/doppler/src/assets_cache.rs @@ -1,6 +1,6 @@ -use crate::gaia::mesh::Texture; -use crate::gaia::model::Model; -use crate::gaia::utils::load_texture_from_dir; +use crate::mesh::Texture; +use crate::model::Model; +use crate::utils::load_texture_from_dir; use log::info; use std::collections::HashMap; diff --git a/src/gaia/camera.rs b/doppler/src/camera.rs similarity index 99% rename from src/gaia/camera.rs rename to doppler/src/camera.rs index b7fa31d..0287b12 100644 --- a/src/gaia/camera.rs +++ b/doppler/src/camera.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] #[cfg(feature = "imgui_inspect")] -use crate::gaia::imgui_helper::*; +use crate::imgui_helper::*; use cgmath; use cgmath::prelude::*; use cgmath::vec3; diff --git a/src/gaia/client.rs b/doppler/src/client.rs similarity index 76% rename from src/gaia/client.rs rename to doppler/src/client.rs index f33fe70..cf43a6f 100644 --- a/src/gaia/client.rs +++ b/doppler/src/client.rs @@ -1,10 +1,9 @@ -use crate::gaia::assets_cache::AssetsCache; -use crate::gaia::engine::Engine; +use crate::assets_cache::AssetsCache; use glutin::event::{ElementState, VirtualKeyCode}; pub trait Client { fn load_assets(&mut self, cache: &mut AssetsCache); - fn update(&mut self, engine: &Engine, delta: f32); + fn update(&mut self, delta: f32); fn on_keyboard(&mut self, code: &VirtualKeyCode, state: &ElementState); fn on_mouse_scroll(&mut self, yoffset: f32); fn on_mouse_move(&mut self, x: f32, y: f32); diff --git a/src/gaia/components.rs b/doppler/src/components.rs similarity index 93% rename from src/gaia/components.rs rename to doppler/src/components.rs index c4b43f5..d0ead36 100644 --- a/src/gaia/components.rs +++ b/doppler/src/components.rs @@ -1,7 +1,7 @@ #[cfg(feature = "imgui_inspect")] -use crate::gaia::imgui_helper::*; -use crate::gaia::model::Model; -use crate::gaia::shader::Shader; +use crate::imgui_helper::*; +use crate::model::Model; +use crate::shader::Shader; use cgmath::{vec3, Matrix4, Rad, Vector3}; #[cfg(feature = "imgui_inspect")] use imgui; diff --git a/src/gaia/consts.rs b/doppler/src/consts.rs similarity index 100% rename from src/gaia/consts.rs rename to doppler/src/consts.rs diff --git a/src/gaia/engine.rs b/doppler/src/engine.rs similarity index 96% rename from src/gaia/engine.rs rename to doppler/src/engine.rs index 5f841de..e3f1f13 100644 --- a/src/gaia/engine.rs +++ b/doppler/src/engine.rs @@ -1,16 +1,15 @@ -use crate::example_client::ExampleClient; -use crate::gaia::assets_cache::AssetsCache; -use crate::gaia::client::Client; -use crate::gaia::consts; -use crate::gaia::framebuffer::FramebufferSystem; +use crate::assets_cache::AssetsCache; +use crate::client::Client; +use crate::consts; +use crate::framebuffer::FramebufferSystem; use glutin::event::{Event, KeyboardInput, VirtualKeyCode, WindowEvent}; #[cfg(feature = "imgui_inspect")] use imgui::Context; #[cfg(feature = "imgui_inspect")] use imgui_winit_support::{HiDpiMode, WinitPlatform}; use std::time::Instant; - use log::info; +use log::LevelFilter; #[derive(Debug)] pub struct TimeStep { @@ -63,7 +62,7 @@ pub struct Engine { impl Default for Engine { fn default() -> Self { - Engine { + Self { title: String::from("Doppler demo"), size: (1280, 720), #[cfg(feature = "imgui_inspect")] @@ -73,7 +72,9 @@ impl Default for Engine { } impl Engine { - pub fn run(self) { + pub fn run(self) { + let _ = simple_logging::log_to_file("log.log", LevelFilter::Info); + info!("Starting engine!"); let event_loop = glutin::event_loop::EventLoop::new(); let window = glutin::window::WindowBuilder::new() .with_title(&self.title) @@ -99,7 +100,6 @@ impl Engine { gl::Enable(gl::DEPTH_TEST); } info!("DPI: {}", gl_window.window().scale_factor()); - let mut client = ExampleClient::create(); let mut framebuffer = unsafe { FramebufferSystem::generate(self.size.0, self.size.1) }; #[cfg(feature = "imgui_inspect")] let (mut imgui, mut platform, renderer) = { @@ -161,7 +161,7 @@ impl Engine { style.frame_rounding = style.grab_rounding; imgui.fonts().clear(); imgui.fonts().add_font(&[FontSource::TtfData { - data: include_bytes!("../../resources/FiraSans-SemiBold.ttf"), + data: include_bytes!("../resources/FiraSans-SemiBold.ttf"), size_pixels: 19.0, config: None, }]); @@ -173,7 +173,10 @@ impl Engine { }); (imgui, platform, renderer) }; + info!("Creating AssetCache"); let mut assets_cache = AssetsCache::default(); + info!("Creating client"); + let mut client = Box::new(T::default()); client.load_assets(&mut assets_cache); let mut first_mouse = true; let mut last_x: f32 = consts::SCR_WIDTH as f32 / 2.0; @@ -200,7 +203,7 @@ impl Engine { } Event::MainEventsCleared => { let delta = timestep.delta(); - client.update(&self, delta); + client.update(delta); // other application-specific logic #[cfg(feature = "imgui_inspect")] platform diff --git a/src/gaia/framebuffer.rs b/doppler/src/framebuffer.rs similarity index 99% rename from src/gaia/framebuffer.rs rename to doppler/src/framebuffer.rs index ea10d65..c9b3db1 100644 --- a/src/gaia/framebuffer.rs +++ b/doppler/src/framebuffer.rs @@ -1,4 +1,4 @@ -use crate::gaia::shader::*; +use crate::shader::*; use gl::types::*; use log::{info, warn}; use std::mem; diff --git a/src/gaia/imgui_helper.rs b/doppler/src/imgui_helper.rs similarity index 100% rename from src/gaia/imgui_helper.rs rename to doppler/src/imgui_helper.rs diff --git a/src/gaia/mod.rs b/doppler/src/lib.rs similarity index 56% rename from src/gaia/mod.rs rename to doppler/src/lib.rs index 64bafa0..f15dff5 100644 --- a/src/gaia/mod.rs +++ b/doppler/src/lib.rs @@ -1,3 +1,15 @@ +pub extern crate gl; +pub extern crate glutin; + +#[cfg(feature = "imgui_inspect")] +pub extern crate imgui; +pub extern crate log; +pub extern crate simple_logging; + +pub use cgmath::*; +pub use glutin::*; +pub use imgui::*; + pub mod macros; pub mod assets_cache; diff --git a/src/gaia/light.rs b/doppler/src/light.rs similarity index 98% rename from src/gaia/light.rs rename to doppler/src/light.rs index 99b3684..8ea7832 100644 --- a/src/gaia/light.rs +++ b/doppler/src/light.rs @@ -1,6 +1,6 @@ #[cfg(feature = "imgui_inspect")] -use crate::gaia::imgui_helper::*; -use crate::gaia::shader::Shader; +use crate::imgui_helper::*; +use crate::shader::Shader; use cgmath::{vec3, Matrix4, Vector3}; #[cfg(feature = "imgui_inspect")] use imgui; diff --git a/src/gaia/macros.rs b/doppler/src/macros.rs similarity index 100% rename from src/gaia/macros.rs rename to doppler/src/macros.rs diff --git a/src/gaia/mesh.rs b/doppler/src/mesh.rs similarity index 99% rename from src/gaia/mesh.rs rename to doppler/src/mesh.rs index 3771030..65493b0 100644 --- a/src/gaia/mesh.rs +++ b/doppler/src/mesh.rs @@ -10,7 +10,7 @@ use cgmath::prelude::*; use cgmath::{Vector2, Vector3}; use gl; -use crate::gaia::shader::Shader; +use crate::shader::Shader; // NOTE: without repr(C) the compiler may reorder the fields or use different padding/alignment than C. // Depending on how you pass the data to OpenGL, this may be bad. In this case it's not strictly diff --git a/src/gaia/model.rs b/doppler/src/model.rs similarity index 97% rename from src/gaia/model.rs rename to doppler/src/model.rs index eeed708..2d09a37 100644 --- a/src/gaia/model.rs +++ b/doppler/src/model.rs @@ -1,9 +1,9 @@ #![allow(non_snake_case)] #![allow(dead_code)] -use crate::gaia::assets_cache::AssetsCache; -use crate::gaia::mesh::{Mesh, Texture, Vertex}; -use crate::gaia::shader::Shader; +use crate::assets_cache::AssetsCache; +use crate::mesh::{Mesh, Texture, Vertex}; +use crate::shader::Shader; use cgmath::{vec2, vec3}; use log::{info, warn}; use std::path::Path; diff --git a/src/gaia/shader.rs b/doppler/src/shader.rs similarity index 99% rename from src/gaia/shader.rs rename to doppler/src/shader.rs index 6ae3d39..c18edaa 100644 --- a/src/gaia/shader.rs +++ b/doppler/src/shader.rs @@ -8,7 +8,7 @@ use std::str; use gl; use gl::types::*; -use crate::gaia::consts; +use crate::consts; use cgmath::prelude::*; use cgmath::{Matrix, Matrix4, Vector2, Vector3}; diff --git a/src/gaia/sky.rs b/doppler/src/sky.rs similarity index 98% rename from src/gaia/sky.rs rename to doppler/src/sky.rs index 2ac5fbb..c87b927 100644 --- a/src/gaia/sky.rs +++ b/doppler/src/sky.rs @@ -1,5 +1,5 @@ -use crate::gaia::shader::*; -use crate::gaia::utils::*; +use crate::shader::*; +use crate::utils::*; use cgmath::Matrix4; use gl::types::*; use std::mem; diff --git a/src/gaia/utils.rs b/doppler/src/utils.rs similarity index 100% rename from src/gaia/utils.rs rename to doppler/src/utils.rs diff --git a/src/example_client.rs b/src/example_client.rs index 37ae2ab..d5b1d10 100644 --- a/src/example_client.rs +++ b/src/example_client.rs @@ -1,14 +1,14 @@ -use crate::gaia::assets_cache::AssetsCache; -use crate::gaia::camera::*; -use crate::gaia::client::Client; -use crate::gaia::components::{ModelComponent, Transform}; -use crate::gaia::consts; -use crate::gaia::engine::Engine; -use crate::gaia::light::*; -use crate::gaia::sky::Sky; +use crate::doppler::assets_cache::AssetsCache; +use crate::doppler::camera::*; +use crate::doppler::client::Client; +use crate::doppler::components::{ModelComponent, Transform}; +use crate::doppler::consts; +use crate::doppler::light::*; +use crate::doppler::sky::Sky; use cgmath::prelude::*; use cgmath::{perspective, vec3, Deg, Matrix4, Point3}; use glutin::event::{ElementState, VirtualKeyCode}; +use imgui::*; pub struct ExampleClient { models: Vec, @@ -23,8 +23,8 @@ pub struct ExampleClient { delta: f32, } -impl ExampleClient { - pub fn create() -> ExampleClient { +impl Default for ExampleClient { + fn default() -> Self { let sky = unsafe { Sky::new() }; ExampleClient { delta: 0.0, @@ -145,11 +145,10 @@ impl Client for ExampleClient { } self.sky.draw(view, projection); } - fn update(&mut self, _engine: &Engine, delta: f32) { + fn update(&mut self, delta: f32) { self.delta = delta; } - #[cfg(feature = "imgui_inspect")] fn debug_draw(&mut self, ui: &imgui::Ui) { use imgui::*; if let Some(menu_bar) = ui.begin_main_menu_bar() { diff --git a/src/main.rs b/src/main.rs index 4f2ff7d..e9cd304 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,25 +1,16 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -extern crate gl; -extern crate glutin; - -#[cfg(feature = "imgui_inspect")] -extern crate imgui; -extern crate log; -extern crate simple_logging; - #[macro_use] -mod gaia; +extern crate doppler; + mod example_client; -use crate::gaia::engine::Engine; -use log::info; -use log::LevelFilter; +use doppler::engine::Engine; +use crate::example_client::ExampleClient; pub fn main() { - let _ = simple_logging::log_to_file("log.log", LevelFilter::Info); - info!("Starting engine!"); + let engine = Engine::default(); - engine.run(); + engine.run::(); }