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 KeepStorage = 1 << 7,
41
43 ResourceSpecificFlag = 1 << 16,
44 };
45
46 ENABLE_ENUM_FLAGS(ResourceLoadFlags);
47
50 {
51 // -- Begin Flags copied from ResourceLoadFlags
52
54 None = int(ResourceLoadFlags::None),
55
60 AutoReload = int(ResourceLoadFlags::AutoReload),
67
68 // -- End Flags copied from ResourceLoadFlags
69
72
81 Flip = First,
82
89
96 NoMipMaps = First << 3,
97
101 NoDelete = First << 4,
102
109 };
110
111 ENABLE_ENUM_FLAGS(TextureLoadFlags);
112 ENABLE_DERIVED_FLAGS(TextureLoadFlags, ResourceLoadFlags);
113
115 enum class ModelLoadFlags
116 {
117 // -- Begin Flags copied from ResourceLoadFlags
118
120 None = int(ResourceLoadFlags::None),
121
126 AutoReload = int(ResourceLoadFlags::AutoReload),
133
134 // -- End Flags copied from ResourceLoadFlags
135
138
141
145
149
153
155 SkipMaterials = First << 4,
156
158 NoFlipTexcoords = First << 5,
159
162 };
163
164 ENABLE_ENUM_FLAGS(ModelLoadFlags);
165 ENABLE_DERIVED_FLAGS(ModelLoadFlags, ResourceLoadFlags);
166
168 enum class AssetLoadFlags
169 {
170 // -- Begin Flags copied from ResourceLoadFlags
171
173 None = int(ResourceLoadFlags::None),
174
179 AutoReload = int(ResourceLoadFlags::AutoReload),
186
187 // -- End Flags copied from ResourceLoadFlags
188
191
194
196 NoDefault = First << 1
197 };
198
199 ENABLE_ENUM_FLAGS(AssetLoadFlags);
200 ENABLE_DERIVED_FLAGS(AssetLoadFlags, ResourceLoadFlags);
201
202 void registerResourceFlagTypes();
203 }
204}
205
206template<> inline Cogs::StringView getName<Cogs::Core::ResourceLoadFlags>() { return "ResourceLoadFlags"; }
207template<> inline Cogs::StringView getName<Cogs::Core::TextureLoadFlags>() { return "TextureLoadFlags"; }
208template<> inline Cogs::StringView getName<Cogs::Core::ModelLoadFlags>() { return "ModelLoadFlags"; }
209template<> inline Cogs::StringView getName<Cogs::Core::AssetLoadFlags>() { return "AssetLoadFlags"; }
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
@ KeepStorage
Keep resource cpu storage after upload to the GPU.
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:50
@ 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