KroysAssetApi
Content files and the asset database.
Declaration
Declared in kroys/kroys_plugin.h.
kroys_plugin.h
typedef struct KroysAssetApi { ... } KroysAssetApi;
Members
#uint32_t structSize;Size of this struct as the writer compiled it (sizeof); the reader uses it to detect members appended by later minor versions.
#uint32_t reserved;Padding reserved for later use; leave it 0.
#KroysResult (KROYS_CALL* ReadContentFile)(KroysContext context, const char* path, const KroysByteSink* sink);Reads a content file (content-relative path, '/' separators) into sink. All targets.
#KroysResult (KROYS_CALL* ImportFile)(KroysContext context, const char* sourcePath, const char* destinationFolder);Editor, permission assets.write: imports through plugin importers or the engine's import.
#KroysResult (KROYS_CALL* CreateAssetFile)(KroysContext context, const char* folder, const char* fileName, const void* bytes, size_t size);Editor, permission assets.write: a new file through the asset database (GUID, undoable). A taken name gets " 2", " 3"...
#uint32_t (KROYS_CALL* AssetCount)(KroysContext context);Editor: number of assets in the asset database (built-in assets excluded); 0 elsewhere.
#KroysResult (KROYS_CALL* GetAssetInfo)(KroysContext context, uint32_t index, KroysAssetInfo* outInfo);Editor: the asset at index (0 .. AssetCount - 1).
#KroysResult (KROYS_CALL* ReplaceContentFile)(KroysContext context, const char* path, const void* bytes, size_t size, const char* label);Editor, permission assets.write: replaces the bytes of an existing content file (content-relative path) as one step of the document's undo history named label; undo restores the previous bytes. The asset reloads.
Members
uint32_t structSize; uint32_t reserved; KroysResult (KROYS_CALL* ReadContentFile)(KroysContext context, const char* path, const KroysByteSink* sink); KroysResult (KROYS_CALL* ImportFile)(KroysContext context, const char* sourcePath, const char* destinationFolder); KroysResult (KROYS_CALL* CreateAssetFile)(KroysContext context, const char* folder, const char* fileName, const void* bytes, size_t size); uint32_t (KROYS_CALL* AssetCount)(KroysContext context); KroysResult (KROYS_CALL* GetAssetInfo)(KroysContext context, uint32_t index, KroysAssetInfo* outInfo); KroysResult (KROYS_CALL* ReplaceContentFile)(KroysContext context, const char* path, const void* bytes, size_t size, const char* label);
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.