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 @@
// limitations under the License.
//------------------------------------------------------------------------------
#include "phx/resources/loaders/generic_material_loader.hpp"
#include "phx/resources/generators/material_generator.hpp"
#include <memory>
#include <vector>
......@@ -28,7 +28,7 @@
#include "phx/resources/types/material.hpp"
namespace phx {
std::unique_ptr<Resource> GenericMaterialLoader::Load(
std::unique_ptr<Resource> MaterialGenerator::Load(
const ResourceDeclaration& declaration) {
auto resource = std::make_unique<phx::Material>();
......
......@@ -20,27 +20,27 @@
// limitations under the License.
//------------------------------------------------------------------------------
#ifndef LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_
#define LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_
#ifndef LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
#define LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
#include <memory>
#include "phx/resources/resource_load_strategy.hpp"
namespace phx {
class GenericMaterialLoader final : public ResourceLoadStrategy {
class MaterialGenerator final : public ResourceLoadStrategy {
public:
GenericMaterialLoader() = default;
GenericMaterialLoader(const GenericMaterialLoader &) = delete;
GenericMaterialLoader(GenericMaterialLoader &&) = delete;
~GenericMaterialLoader() = default;
MaterialGenerator() = default;
MaterialGenerator(const MaterialGenerator &) = delete;
MaterialGenerator(MaterialGenerator &&) = delete;
~MaterialGenerator() = default;
GenericMaterialLoader &operator=(const GenericMaterialLoader &) = delete;
GenericMaterialLoader &operator=(GenericMaterialLoader &&) = delete;
MaterialGenerator &operator=(const MaterialGenerator &) = delete;
MaterialGenerator &operator=(MaterialGenerator &&) = delete;
std::unique_ptr<Resource> Load(
const ResourceDeclaration &declaration) override;
};
} // namespace phx
#endif // LIBRARY_PHX_RESOURCES_LOADERS_GENERIC_MATERIAL_LOADER_HPP_
#endif // LIBRARY_PHX_RESOURCES_GENERATORS_MATERIAL_GENERATOR_HPP_
......@@ -26,8 +26,8 @@
#include <string>
#include <utility>
#include "phx/resources/generators/material_generator.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/shader_loader.hpp"
......@@ -96,7 +96,7 @@ void ResourceManager::RegisterImageResourceExtensions() {
void ResourceManager::RegisterResourceGenerators() {
this->RegisterResourceType("GEN_MATERIAL",
std::make_unique<GenericMaterialLoader>());
std::make_unique<MaterialGenerator>());
}
} // namespace phx
......@@ -28,8 +28,8 @@
#include "test_utilities/glm_vec.hpp"
SCENARIO("The Generic Material Loader can create Generic materials.",
"[phx][phx::GenericMaterialLoader]") {
GIVEN("A plain Generic Material Loader") {
"[phx][phx::MaterialGenerator]") {
GIVEN("A plain Generic Material Generator") {
WHEN("We load a red material") {
auto materialResource = phx::ResourceUtils::LoadGenericMaterial(
"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