A little toolkit for single-quad fragment shader demos
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
839 B

  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. #include <memory>
  5. #include <experimental/filesystem>
  6. #include <cpptoml.h>
  7. #include "shaders.h"
  8. namespace fs = std::experimental::filesystem;
  9. class Scene {
  10. public:
  11. std::string name;
  12. ShaderBundle::ProgramHandle* shader_p;
  13. };
  14. class NullScene : public Scene {
  15. };
  16. class Project {
  17. public:
  18. Project() = default;
  19. static Project fromFile(std::string path);
  20. static Project fromFile(fs::path path);
  21. static Project fromToml(std::shared_ptr<cpptoml::table> manifest, fs::path basepath);
  22. void load_scene(std::shared_ptr<Scene> scene);
  23. void reload_shaders();
  24. void unload_project();
  25. std::vector<std::shared_ptr<Scene>> scenes;
  26. std::shared_ptr<Scene> current_scene;
  27. bool scene_loaded = false;
  28. std::string name;
  29. fs::path basepath;
  30. std::shared_ptr<ShaderBundle> shader_bundle;
  31. };