Skip to content
Snippets Groups Projects
Commit d108c8d9 authored by Andrea Bönsch's avatar Andrea Bönsch
Browse files

Merge branch 'feature/#485_notion_separation_of_loaders_and_generators' into 'master'

Feature/#485 notion separation of loaders and generators

See merge request VR-Group/Project_Phoenix!154
parents 2dcbc67f fc73ff05
No related branches found
No related tags found
1 merge request!154Feature/#485 notion separation of loaders and generators
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// limitations under the License. // limitations under the License.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#include "phx/resources/loaders/generic_material_loader.hpp" #include "phx/resources/generators/material_generator.hpp"
#include <memory> #include <memory>
#include <vector> #include <vector>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "phx/resources/types/material.hpp" #include "phx/resources/types/material.hpp"
namespace phx { namespace phx {
std::unique_ptr<Resource> GenericMaterialLoader::Load( std::unique_ptr<Resource> MaterialGenerator::Load(
const ResourceDeclaration& declaration) { const ResourceDeclaration& declaration) {
auto resource = std::make_unique<phx::Material>(); auto resource = std::make_unique<phx::Material>();
......
...@@ -20,27 +20,27 @@ ...@@ -20,27 +20,27 @@
// limitations under the License. // limitations under the License.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
#ifndef LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_ #ifndef LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
#define LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_ #define LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
#include <memory> #include <memory>
#include "phx/resources/resource_load_strategy.hpp" #include "phx/resources/resource_load_strategy.hpp"
namespace phx { namespace phx {
class GenericMaterialLoader final : public ResourceLoadStrategy { class MaterialGenerator final : public ResourceLoadStrategy {
public: public:
GenericMaterialLoader() = default; MaterialGenerator() = default;
GenericMaterialLoader(const GenericMaterialLoader &) = delete; MaterialGenerator(const MaterialGenerator &) = delete;
GenericMaterialLoader(GenericMaterialLoader &&) = delete; MaterialGenerator(MaterialGenerator &&) = delete;
~GenericMaterialLoader() = default; ~MaterialGenerator() = default;
GenericMaterialLoader &operator=(const GenericMaterialLoader &) = delete; MaterialGenerator &operator=(const MaterialGenerator &) = delete;
GenericMaterialLoader &operator=(GenericMaterialLoader &&) = delete; MaterialGenerator &operator=(MaterialGenerator &&) = delete;
std::unique_ptr<Resource> Load( std::unique_ptr<Resource> Load(
const ResourceDeclaration &declaration) override; const ResourceDeclaration &declaration) override;
}; };
} // namespace phx } // namespace phx
#endif // LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_ #endif // LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "phx/resources/generators/material_generator.hpp"
#include "phx/resources/loaders/assimp_model_loader.hpp" #include "phx/resources/loaders/assimp_model_loader.hpp"
#include "phx/resources/loaders/generic_material_loader.hpp"
#include "phx/resources/loaders/image_loader.hpp" #include "phx/resources/loaders/image_loader.hpp"
#include "phx/resources/loaders/shader_loader.hpp" #include "phx/resources/loaders/shader_loader.hpp"
...@@ -96,7 +96,7 @@ void ResourceManager::RegisterImageResourceExtensions() { ...@@ -96,7 +96,7 @@ void ResourceManager::RegisterImageResourceExtensions() {
void ResourceManager::RegisterResourceGenerators() { void ResourceManager::RegisterResourceGenerators() {
this->RegisterResourceType("GEN_MATERIAL", this->RegisterResourceType("GEN_MATERIAL",
std::make_unique<GenericMaterialLoader>()); std::make_unique<MaterialGenerator>());
} }
} // namespace phx } // namespace phx
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
#include "test_utilities/glm_vec.hpp" #include "test_utilities/glm_vec.hpp"
SCENARIO("The Generic Material Loader can create Generic materials.", SCENARIO("The Generic Material Loader can create Generic materials.",
"[phx][phx::GenericMaterialLoader]") { "[phx][phx::MaterialGenerator]") {
GIVEN("A plain Generic Material Loader") { GIVEN("A plain Generic Material Generator") {
WHEN("We load a red material") { WHEN("We load a red material") {
auto materialResource = phx::ResourceUtils::LoadGenericMaterial( auto materialResource = phx::ResourceUtils::LoadGenericMaterial(
"generic_material", glm::vec3(1.f, 0.f, 0.f)); "generic_material", glm::vec3(1.f, 0.f, 0.f));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment