Cogs.Core
ResourceFlags.h
1#pragma once
2
3#include "Base.h"
4#include "Flags.h"
5
6#include "Foundation/Reflection/Name.h"
7
8namespace Cogs
9{
10 namespace Core
11 {
12 // Note that Flags here are also copied in enums "inheriting" from ResourceLoadFlags.
13
16 {
18 None = 0,
19
21 ForceSynchronous = 1 << 0,
22
24 Reload = 1 << 1,
25 AutoReload = 1 << 2,
26
28 NoDefaultName = 1 << 3,
29
31 ForceUnique = 1 << 4,
32
34 DoNotCache = 1 << 5,
35
37 DoNotStoreSource = 1 << 6,
38
40 ResourceSpecificFlag = 1 << 16,
41 };
42
43 ENABLE_ENUM_FLAGS(ResourceLoadFlags);
44
47 {
48 // -- Begin Flags copied from ResourceLoadFlags
49
51 None = int(ResourceLoadFlags::None),
52
57 AutoReload = int(ResourceLoadFlags::AutoReload),
64
65 // -- End Flags copied from ResourceLoadFlags
66
69
78 Flip = First,
79
86
93 NoMipMaps = First << 3,
94
98 NoDelete = First << 4,
99
106 };
107
108 ENABLE_ENUM_FLAGS(TextureLoadFlags);
109 ENABLE_DERIVED_FLAGS(TextureLoadFlags, ResourceLoadFlags);
110
112 enum class ModelLoadFlags
113 {
114 // -- Begin Flags copied from ResourceLoadFlags
115
117 None = int(ResourceLoadFlags::None),
118
123 AutoReload = int(ResourceLoadFlags::AutoReload),
130
131 // -- End Flags copied from ResourceLoadFlags
132
135
138
142
146
150
152 SkipMaterials = First << 4,
153
155 NoFlipTexcoords = First << 5,
156
159 };
160
161 ENABLE_ENUM_FLAGS(ModelLoadFlags);
162 ENABLE_DERIVED_FLAGS(ModelLoadFlags, ResourceLoadFlags);
163
165 enum class AssetLoadFlags
166 {
167 // -- Begin Flags copied from ResourceLoadFlags
168
170 None = int(ResourceLoadFlags::None),
171
176 AutoReload = int(ResourceLoadFlags::AutoReload),
183
184 // -- End Flags copied from ResourceLoadFlags
185
188
191
193 NoDefault = First << 1
194 };
195
196 ENABLE_ENUM_FLAGS(AssetLoadFlags);
197 ENABLE_DERIVED_FLAGS(AssetLoadFlags, ResourceLoadFlags);
198
199 void registerResourceFlagTypes();
200 }
201}
202
203template<> inline Cogs::StringView getName<Cogs::Core::ResourceLoadFlags>() { return "ResourceLoadFlags"; }
204template<> inline Cogs::StringView getName<Cogs::Core::TextureLoadFlags>() { return "TextureLoadFlags"; }
205template<> inline Cogs::StringView getName<Cogs::Core::ModelLoadFlags>() { return "ModelLoadFlags"; }
206template<> inline Cogs::StringView getName<Cogs::Core::AssetLoadFlags>() { return "AssetLoadFlags"; }
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
ModelLoadFlags
Model loading flags. May be combined with resource loading flags.
@ NeedsTangents
The importer should generate tangent data if not present.
@ CustomExtensionFlag
Custom flag that can be used by an extension loader.
@ SkipMaterials
Tell the loader it may skip creating material instances during loading.
@ NoFlipTexcoords
Do not flip texture coordinates.
ResourceLoadFlags
Flags for describing how to load a resource.
Definition: ResourceFlags.h:16
@ ResourceSpecificFlag
DO NOT USE. Intenal: First available flag for resource specific flags.
@ None
No flags specified,.
@ NoDefaultName
No default name.
@ DoNotStoreSource
Don't store the source.
@ ForceUnique
Force unique resource load when source resolves to existing resource.
@ ForceSynchronous
Force loading the resource synchronously.
@ DoNotCache
Do not cache this resource for later retrieval.
TextureLoadFlags
Texture loading flags. May be combined with resource load flags.
Definition: ResourceFlags.h:47
@ LinearColorSpace
For textures with RGBA format without color space information, mark the data as being in linear color...
@ ColorSpaceFromLoadInfo
by default we want to retrieve colorspace info from the texture data, not from the format specified i...
@ First
DO NOT USE. Intenal: First available flag for resource specific flags.
@ NoDelete
Do not assume ownership of external texture so it won't be deleted by cogs.
@ Flip
Flip the texture data vertically before it is passed to the rendering backend.
@ NoMipMaps
Do not generate mipmaps.
AssetLoadFlags
Asset and Scene loading flags. May be combined with resource loading flags.
@ NoDefault
Don't load the default scene. Highly recommended as not setting this flag cause extra scene parse.
@ ClearScene
Clear the scene before loading the asset. NOT allowed for Bridge: loadAsset and loadAssetFromString.
Contains all Cogs related functionality.
Definition: FieldSetter.h:23