Cogs.Core
MeshManager.h
1#pragma once
2
3#include "ResourceManager.h"
4
5#include "Mesh.h"
6
7namespace Cogs
8{
9 namespace Core
10 {
17 class MeshManager : public ResourceManager<Mesh, ResourceLoadInfoBase>
18 {
19 public:
21 MeshManager(Context * context);
22
24 ~MeshManager() override;
25
28 void initialize() override;
29
30 size_t currentSwapQueueSize() const { return swapQueue.size(); }
31
32 MeshHandle getMesh(const StringView & name);
33
34 void handleLoad(ResourceLoadInfoBase * loadInfo) override;
35
38
40 void handleDeletion(Mesh * mesh) override;
41
43 void processSwapping() override;
44
45 void processDeletion() override;
46
47 void destroyInternal(ResourceBase * resource) override;
48
49 ResourceBufferHandle createBuffer();
50
51 private:
52 std::unique_ptr<struct MeshManagerData> data;
53 };
54 }
55}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Mesh manager handling the creation, processing and lifetime of Mesh resources.
Definition: MeshManager.h:18
void processDeletion() override
Process resources pending deallocation.
ActivationResult handleActivation(ResourceHandle handle, Mesh *mesh) override
Overridden to handle mesh activation, updating the resource in the renderer.
void handleLoad(ResourceLoadInfoBase *loadInfo) override
Handler for resource loading.
void initialize() override
void handleDeletion(Mesh *mesh) override
Overridden to handle mesh deletion, removing the resource from the renderer.
~MeshManager() override
Destructs the MeshManager.
void processSwapping() override
Overridden to dispatch async updates for swapping resources if enabled.
The generic resource manager provides a base implementation for specialized resource managers to buil...
ResourceHandle_t< Mesh > ResourceHandle
Type of handle used to hold resources.
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
ActivationResult
Defines results for resource activation.
Definition: ResourceBase.h:14
Contains all Cogs related functionality.
Definition: FieldSetter.h:23
Meshes contain streams of vertex data in addition to index data and options defining geometry used fo...
Definition: Mesh.h:265
Base class for engine resources.
Definition: ResourceBase.h:107