Implementing basic asset serialization

This commit is contained in:
Dynamitos
2023-02-13 14:56:13 +01:00
parent 9e1e4076f0
commit 48fa098546
82 changed files with 1834 additions and 423 deletions
+8 -2
View File
@@ -2,6 +2,7 @@
#include "MinimalEngine.h"
#include "GraphicsEnums.h"
#include "GraphicsResources.h"
#include "Serialization/ArchiveBuffer.h"
namespace Seele
{
@@ -75,8 +76,11 @@ struct VertexStreamComponent
{}
};
#define STRUCTMEMBER_VERTEXSTREAMCOMPONENT(vertexBuffer, vertexType, member, memberType) \
VertexStreamComponent(vertexBuffer, offsetof(vertexType, member), sizeof(vertexType), memberType)
namespace Serialization
{
void save(ArchiveBuffer& buffer, VertexStreamComponent& comp);
void load(ArchiveBuffer& buffer, VertexStreamComponent& comp);
} // namespace Serialization
class VertexInputType
{
@@ -120,6 +124,8 @@ public:
void getPositionOnlyStream(VertexInputStreamArray& outVertexStreams) const;
virtual bool supportsTesselation() { return false; }
virtual VertexInputType* getType() const { return nullptr; }
virtual void save(ArchiveBuffer& buffer) {}
virtual void load(ArchiveBuffer& buffer) {}
Gfx::PVertexDeclaration getDeclaration() const {return declaration;}
Gfx::PVertexDeclaration getPositionDeclaration() const {return positionDeclaration;}
std::string getName() const { return name; }