A test for how Gemini can clean-up code. Changes:
- Configuration Struct: Global variables have been grouped into an
AppConfig struct. This makes the program's configuration explicit and
avoids polluting the global namespace.
- Clearer Argument Parsing: The handleArguments function now returns an
AppConfig object, encapsulating all parsing logic and making the main
function cleaner.
- Helper Functions: Repetitive tasks like string replacement, file I/O,
and writing file entries have been extracted into small, well-defined
helper functions (replaceAll, openOutputFile, readFile, etc.).
- Simplified main Function: The main function is now a high-level
coordinator, delegating work to helper functions. This makes the overall
program flow much easier to follow.
- Modern C++ Idioms: The code now consistently uses C++ streams
(std::cout, std::ofstream) and std::string objects, which is more
idiomatic than a mix of C and C++ styles.
- added short comments
instead of using a single resource binary for all materials, each
postfx set of materials (e.g. dof, bloom) gets its own resource file
based on the directory it is in.
resgen now generates the resources size/offset directly as #define
instead of as an `extern` variable. The assembly file also
doesn't generate the corresponding global variables, saving some binary
space.
* Begin Sorting SubProjects into Folders
* Add more subprojects to folders
* Add even more subprojects to folders
* Add further subprojects to folders
* Move the last two projects
* Move Resources to a Resources subfolder
* Remove spaces to be stylistically coherent
* Revert Improper CMake Modifications
* Revert erroneous line removals
* Only specify sdl2's folder on WIN32
* Add the shader subprojects to a Generated folder
* Move shaders to Filament/Shaders
This option embeds a small JSON string inside the resgen blob that lists
all materials and their respective sizes. This is useful when analyzing
the footprint of the binary executable.
* Make CMake 3.10 the minimum version, add LTO option
* Install a newer CMake on Linux CI builds
* Update LLVM and Cmake on Windows CI
* Update build/windows/ci-common.bat
Co-Authored-By: Ben Doherty <benjdoherty15@gmail.com>
* Update formatting
* Apply suggestions from code review
* Update build/windows/ci-common.bat
* Update CMake
* Switch Android projects back to CMake 3.6
(1)
Generating the C file (only used for WebAssembly) causes slowness in the
build so this makes it into an option. Also, we were flushing too often,
which made it even slower.
(2)
Using "static" in a header was causing symbol duplication.
This adds a couple optional features:
1) Preserve file extensions when generating symbols.
This is useful to distinguish foo.vs from foo.fs
2) Append null characters to data blobs.
Useful when treating FOO_DATA as a C string.
This tool can be used to replace inc files for built-in materials. The
inc files are unfriendly to IDE's and do not extend to non-material
resource types such as baked texture data.
The tool aggregates a sequence of binary blobs, each of which becomes a
"resource" whose id is the basename of the input file. It produces the
following set of files:
resources.h ......... declares sizes and offsets for each resource
resources.S ......... small assembly file with incbin directive
resources.apple.S ... ditto but with different rodata name
resources.bin ....... the aggregated binary blob
resources.c ......... large xxd-style array (only for WASM)
We did an experiment to test the incbin directive on a variety of
platforms in PR #510.