Commit graph

18 commits

Author SHA1 Message Date
Gered c7d6bd8aef revert app_root_dir usages in examples. re-org example asset files
ultimately, cargo workspaces are kind of weird. you can do things like
`cargo run` from the top-level cargo.toml file and run an individual
sub-module via `--bin`, or you can go to that sub-module's directory
where it's own cargo.toml is, and `cargo run` directly from there.

the current working directory will be different in each case, and this
difference can be very annoying when you want to do seemingly-logical
things like organize sub-module "asset" files (e.g. images, and other
types of data files that aren't code) within that sub-module's
directory. in this case, how do you write code in that sub-module that
can load those asset files in a way that will work in BOTH of the
aforementioned scenarios for `cargo run`?

you can't really! some people use the `CARGO_MANIFEST_DIR` environment
variable that cargo sets when running any given cargo module, but this
is only a valid method for obtaining the module's root directory when
running from a cargo command ... which you won't be doing when running
within a debugger! likely you or your IDE invoked the debugger process
against the already built executable directly, so `CARGO_MANIFEST_DIR`
will not be set and you're back to square one!

super annoying!

as such, i am now giving up and am just doing what it seems like most
other cargo projects that utilize workspaces do ... place all the
assets for all sub-modules together in the same directory, relative
to the workspace root.

why go with this approach?

because it works under the most common scenarios (but NOT all!):
- running via `cargo run --bin` from the workspace root
- debugging via gdb/lldb etc using the workspace root as the cwd

these seem to be the most common ways to do each type of task from
any rust-equipped editor/IDE that i've seen so far.
2024-09-05 22:35:20 -04:00
Gered 4d359f3e3c update all explicit Path instance allocation and use
previously, there were a ton of places that were allocating new Path
instances via `Path::new` for the purpose of creating a path to be
passed into a function as a Path argument

this has now been simplified everywhere by updating all functions
and methods that previously took Path arguments to instead take
AsRef<Path> arguments, allowing much more flexibility in the types
of path arguments passed in
2024-09-04 00:31:30 -04:00
Gered 0cbd5366fd add app_root_dir helper function. integrate with all examples 2024-09-03 00:00:07 -04:00
Gered 74d7f2b22c use workspace.dependencies for common dependency versions 2024-07-21 16:07:33 -04:00
Gered 0f8377455c update dependencies 2023-11-11 13:52:58 -05:00
Gered 4f3a629f5a simplify
how did i not see this. lol
2023-05-26 21:09:37 -04:00
Gered ec6d0f1b73 convenience method for creating a basic image widget 2023-05-26 12:12:45 -04:00
Gered 3bb12fdcee update imgui example with image widgets showing slime colors/bitmaps 2023-05-26 12:04:02 -04:00
Gered 3a56926345 the big switch from ARGB to RGBA format for 32-bit color pixels 2023-05-05 18:14:37 -04:00
Gered 78d8102a23 rename color types to somewhat less "noisy" names
plus these are easier to type.

i do not anticipate needing structured color types for any other
type of components (e.g. i don't see a need for an ARGBu16x4, etc).
so i am fine with just having `ARGB` being associated with four u8's
with no real indication of this in the type name itself.
2023-05-05 15:56:29 -04:00
Gered 09dbb913a5 convert RgbaBitmap to use ARGBu8x4 as its pixel type 2023-05-04 18:54:37 -04:00
Gered f64bba30d2 update screenshot 2023-04-15 02:19:38 -04:00
Gered e9ea08c882 add "push" button to imgui_integration 2023-04-15 02:17:02 -04:00
Gered 0cae9d0367 fix move entity button not working for all entities 2023-04-15 02:09:15 -04:00
Gered cb3a2673f9 add ability to move entities to imgui_integration example 2023-04-14 19:22:16 -04:00
Gered 49301a0be9 add readme for imgui_integration example 2023-04-14 14:00:02 -04:00
Gered 21259bfb10 show an imgui window with entity info, etc 2023-04-14 13:59:38 -04:00
Gered 424c63d414 imgui_integration example initial commit, work in progress
mostly working, but the imgui ui part is only a placeholder.

also this example project is kind of overly complicated, but i really
wanted this to be something that somewhat resembles a real tool that
i'd want to build.
2023-04-10 19:40:46 -04:00