Rather than having the entire implementation within `emulator.cpp`,
causing incremental builds to be much slower, give it its own
translation unit `stb_image_write.c`.
Allows the return-type to be specified, allowing a concise final cast
after extracting the bit-type. Addresses the remaining `C4244` warnings
regarding `getBits`.
The non-error-code version of these functions are susceptible to
throwing an exception in the case of system errors like permission
issues or underlying device errors.
Adds a project-wide setting for allowing renderer code to add additional
diagnostic data. Currently used to allow `opengl.hpp` to conditionally
implement debug-labeling and scopes.
Simply define this object in a C++ scope like:
```cpp
OpenGL::DebugScope glScope("Renderer::display");
```
and it will associate all functions within the current scope within a
named group. Supports `printf` formatting.
Makes the implementation of `IOFile` private, allowing inclusions and
defines such as `#define fseeko` and `#include <io.h>` to not poison
client-code or the global namespace.
Makes framebuffer-formats unrepresentable from texture formats while
allowing them to alias each other. Add utility functions as well that
just re-use the `TextureFmt` ones.
Slowly stepping the codebase towards having renderer-agnostic types and keeping the translation of PICA-types to OpenGL/VK/DX/Software/etc to the renderer-backend.
Following the trend of #33: `std::span` provides some useful utility
functions like `size_bytes()` and `as_bytes()` and serves as a better
non-owning "chunk of data"-type over just passing around an
`std::array&`.
Use the command `clang-format -i tests/**/*.c src/**/*.cpp include/**/*.hpp`
to process all of the project's files.
Using the one from [pcsx-redux](https://github.com/grumpycoders/pcsx-redux/blob/main/src/.clang-format)
as a basis and then made additional edits to be the _least_ disruptive
to the pre-existing formatting patterns.
`constexpr` functions for extractint bitfields that lends itself a bit
better to emitting instructions like `bextr` on x86 or `ubfx` on arm64.
And may subjectively make things a bit more readable.
"Extract `5` bits" rather than `& 0x1F`.