Skip to content
Snippets Groups Projects
Commit 1902248e authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

start of asset loading

parent 6109d35b
No related branches found
No related tags found
No related merge requests found
# non-free (non-CC) assets for testing
nonfree/
---
id: "com.fossgalaxy.games.demo"
name: "Demo Content Pack"
#include <filesystem>
#include <iostream>
#include <fggl/gfx/window.hpp>
#include <fggl/gfx/ogl.hpp>
#include <fggl/gfx/renderer.hpp>
......@@ -10,6 +10,30 @@
#include <fggl/debug/debug.h>
#include <fggl/data/storage.hpp>
// prototype of resource discovery
void discover(std::filesystem::path base) {
std::vector< std::filesystem::path > contentPacks;
for ( auto& item : std::filesystem::directory_iterator(base) ) {
// content pack detection
if ( std::filesystem::is_directory( item ) ) {
auto manifest = item.path() / "manifest.yml";
if ( std::filesystem::exists( manifest ) ) {
contentPacks.push_back( item.path() );
}
}
}
// what did we find?
std::cerr << "found pack(s): " << std::endl;
for ( auto& pack : contentPacks ) {
std::cerr << pack << std::endl;
}
}
int main(int argc, char* argv[]) {
fggl::gfx::Context ctx;
......@@ -21,10 +45,14 @@ int main(int argc, char* argv[]) {
fggl::gfx::Graphics ogl(win);
fggl::gfx::MeshRenderer meshRenderer;
// debug layer
fggl::debug::DebugUI debug(win);
debug.visible(false);
// storage API
fggl::data::Storage storage;
discover( storage.resolvePath(fggl::data::Data, "res") );
fggl::gfx::ShaderCache cache(storage);
fggl::gfx::ShaderConfig config;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment