Cogs.Core
ModelWriter.h
1#pragma once
2
3#include "Base.h"
4
5#include "Foundation/StringView.h"
6
8{
9 class Entity;
10}
11
12namespace Cogs::Core
13{
14 class Context;
15 struct CogsDescriptor;
16
17 enum struct WriteModelFlags : uint32_t {
18 NONE = 0,
19 COMPRESS_ZSTD = 1u<<0, //< Compresses sections in the file, allows to decompress just part of the file.
20 COMPRESS_ZSTD_AS_FILE = 1u<<1, //< Compresses the entire model as a single file, creates .cogsbin.zst file.
21 COMPRESS_MAX = 1u<<2,
22 SEPARATE_ROOT_NODE_SECTIONS = 1u<<3,
23 EMBED_TEXTURES = 1u<<4,
24 };
25 ENABLE_ENUM_FLAGS(WriteModelFlags);
26
28 {
29 WriteModelFlags flags = WriteModelFlags::NONE;
30 int compressionLevel = 3;
31 };
32
33 // Deprecated, remove when no longer in use.
34 bool writeCogsBin3Model(Context * context, uint32_t& numVertes, uint32_t& numIndexes, const StringView & fileName, const struct Model * model, WriteModelSettings * settings);
35 bool writeCogsBin3Models(Context * context, uint32_t& numVertes, uint32_t& numIndexes, const StringView & fileName, ComponentModel::Entity ** entity, size_t N, WriteModelFlags flags = WriteModelFlags::COMPRESS_ZSTD | WriteModelFlags::COMPRESS_MAX);
36
37 COGSCORE_DLL_API bool writeModel(Context * context, uint32_t& numVertes, uint32_t& numIndexes, const StringView & fileName, ComponentModel::Entity * entity, WriteModelFlags flags = WriteModelFlags::COMPRESS_ZSTD | WriteModelFlags::COMPRESS_MAX);
38 COGSCORE_DLL_API bool writeModel(Context * context, uint32_t& numVertes, uint32_t& numIndexes, const StringView & fileName, const struct Model * model, WriteModelSettings * settings);
39 COGSCORE_DLL_API bool writeModels(Context * context, uint32_t& numVertes, uint32_t& numIndexes, const StringView & fileName, ComponentModel::Entity ** entity, size_t N, WriteModelFlags flags = WriteModelFlags::COMPRESS_ZSTD | WriteModelFlags::COMPRESS_MAX);
40 COGSCORE_DLL_API bool writeModel(Context * context, const StringView & fileName, ComponentModel::Entity * entity, WriteModelFlags flags = WriteModelFlags::COMPRESS_ZSTD | WriteModelFlags::COMPRESS_MAX);
41}
Container for components, providing composition of dynamic entities.
Definition: Entity.h:18
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Contains code for composing and managing entities built from components.
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
Model resources define a template for a set of connected entities, with resources such as meshes,...
Definition: Model.h:56