Cogs.Core
SubMeshRenderComponent.h
1#pragma once
2
3#include "Components/Core/RenderComponent.h"
4
5#include "Rendering/Common.h"
6
7#include "Resources/Resources.h"
8
9namespace Cogs::Core
10{
15 {
16 public:
18 static void registerType();
19
21 std::vector<MaterialInstanceHandle> materials;
22
24 int subMesh = -1;
25
26 void setMaterial(MaterialInstanceHandle material)
27 {
28 materials = { material };
29 }
30 };
31}
32
33template<> inline Cogs::StringView getName<Cogs::Core::SubMeshRenderComponent>() { return "SubMeshRenderComponent"; }
Base component for all rendering content.
Renders a mesh with flexible submesh usage.
std::vector< MaterialInstanceHandle > materials
Materials used to render individual sub-meshes.
static void registerType()
Register the type in the type system.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....