Dawn/src/dawn/component/display/material/SimpleTexturedMaterial.hpp

60 lines
1.4 KiB
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "component/display/material/Material.hpp"
#include "display/Texture.hpp"
namespace Dawn {
struct SimpleTexturedMaterialShaderData {
int32_t t;
struct Color color;
glm::mat4 model;
glm::mat4 projection;
glm::mat4 view;
bool hasTexture;
};
class SimpleTexturedMaterial : public Material {
private:
struct SimpleTexturedMaterialShaderData data;
std::shared_ptr<Texture> texture;
protected:
public:
void load(std::shared_ptr<SceneLoadContext> ctx) override;
/**
* Returns the color of this material.
*/
struct Color getColor();
/**
* Returns the texture of this material.
*
* @return The texture of this material.
*/
std::shared_ptr<Texture> getTexture();
/**
* Sets the texture of this material.
*
* @param texture The texture to set.
*/
void setTexture(const std::shared_ptr<Texture> texture);
/**
* Sets the color of this material.
*
* @param color The color to set.
*/
void setColor(const struct Color color);
std::vector<std::shared_ptr<RenderPass>> getPasses(
struct RenderPassContext &ctx
) override;
};
}