Gered's Game Dev Tools. A for-fun, retro-style set of game dev tools and other code to help with my own projects.
Go to file
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
.github/workflows add actions workflow to do cargo check and test 2023-03-28 21:03:09 -04:00
assets revert app_root_dir usages in examples. re-org example asset files 2024-09-05 22:35:20 -04:00
examples revert app_root_dir usages in examples. re-org example asset files 2024-09-05 22:35:20 -04:00
ggdt update all explicit Path instance allocation and use 2024-09-04 00:31:30 -04:00
ggdt_imgui use workspace.dependencies for common dependency versions 2024-07-21 16:07:33 -04:00
.gitignore update gitignore 2022-05-15 12:14:12 -04:00
Cargo.toml use workspace.dependencies for common dependency versions 2024-07-21 16:07:33 -04:00
README.md rename from libretrogd to ggdt 2023-03-02 16:11:59 -05:00
rust-toolchain.toml update dependencies 2023-11-11 13:52:58 -05:00
rustfmt.toml add rustfmt.toml to the project root 2023-03-27 18:46:33 -04:00

ggdt: Gered's Game Dev Tools

This is a purely for-fun project of mine. It's a personal set of retro-like/inspired game development tools for use in my own projects.

It started with a focus on DOS "VGA mode 13h"-style limitations, but is not going to be limited to just that into the future and will be expanded on as I need it to do other things. It should be noted that in this project I will do a lot of (poor) reinventing of the wheel ... because it's fun. Stringing together existing libraries all the time is dull after a while.

I'm not an expert in Rust and am probably still doing a great many things unidiomatically. But I'm learning, and that is at least half the point of this project in the first place.

See the /examples directory for some demo apps. These will be added to over time.