47 Data.IsTexture =
false;
49 DataBuffer->Update(&Data,
sizeof(Data));
55 if (this->Texture) this->Texture->Free();
56 this->Texture = Texture;
59 Data.IsTexture =
true;
60 DataBuffer->Update(&Data,
sizeof(Data));
90 this->Texture = Texture;
91 Data.IsTexture =
true;
117 if (DataBuffer) DataBuffer->Unbind();
118 if (Texture && Data.IsTexture) Texture->Unbind();
128 return CreateShared<material_single_color>(Color);
138 return CreateShared<material_single_color>(Texture);
Buffer interfaces implementation module.
static shared< constant_buffer > Create(u32 Size)
void Unbind() const override
void Bind() const override
material_single_color(shared< texture_2d > Texture)
static shared< material_single_color > Create(shared< texture_2d > Texture)
material_single_color(const material_single_color &MaterialData)=default
const vec3 & GetColor() const
material_single_color()=default
const shared< texture_2d > & GetTexture() const
static shared< material_single_color > Create(const vec3 &Color)
material_single_color(const vec3 &Color)
void SetColor(const vec3 &Color)
void SetTexture(shared< texture_2d > Texture)
shared< shader_program > Shader
static const int BINDING_POINT_MATERIAL_DATA
static const int TEXTURE_SLOT_MATERIAL_DIFFUSE
Mesh material class deinition module.
std::shared_ptr< T > shared
Render bridge class implementation module. Static class for making calls to low-level render api,...
Texture interface definition module.