NcEngine
Assets.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "ncasset/AssetType.h"
10
11#include <span>
12
13namespace nc::asset
14{
15struct Texture;
23bool LoadAudioClipAsset(const std::string& path);
24bool LoadAudioClipAssets(std::span<const std::string> paths);
25bool UnloadAudioClipAsset(const std::string& path);
26void UnloadAllAudioClipAssets();
27auto AcquireAudioClipAsset(const std::string& path) -> AudioClipView;
28auto AcquireAudioClipAsset(AssetId id) -> AudioClipView;
29
31bool LoadMeshColliderAsset(const std::string& path);
32bool LoadMeshColliderAssets(std::span<const std::string> paths);
33bool UnloadMeshColliderAsset(const std::string& path);
34void UnloadAllMeshColliderAssets();
35auto AcquireMeshColliderAsset(const std::string& path) -> MeshColliderView;
36auto AcquireMeshColliderAsset(AssetId id) -> MeshColliderView;
37
39bool LoadConvexHullAsset(const std::string& path);
40bool LoadConvexHullAssets(std::span<const std::string> paths);
41bool UnloadConvexHullAsset(const std::string& path);
42void UnloadAllConvexHullAssets();
43auto AcquireConvexHullAsset(const std::string& path) -> ConvexHullView;
44auto AcquireConvexHullAsset(AssetId id) -> ConvexHullView;
45
49bool LoadCubeMapAsset(const std::string& path);
50bool LoadCubeMapAssets(std::span<const std::string> paths);
51bool UnloadCubeMapAsset(const std::string& paths);
52void UnloadAllCubeMapAssets();
53auto AcquireCubeMapAsset(const std::string& path) -> CubeMapView;
54auto AcquireCubeMapAsset(AssetId id) -> CubeMapView;
55
59bool LoadMeshAsset(const std::string& path);
60bool LoadMeshAssets(std::span<const std::string> paths);
61bool UnloadMeshAsset(const std::string& path);
62void UnloadAllMeshAssets();
63auto AcquireMeshAsset(const std::string& path) -> MeshView;
64auto AcquireMeshAsset(AssetId id) -> MeshView;
65
69bool LoadTextureAsset(const std::string& path);
70bool LoadTextureAssets(std::span<const std::string> paths);
71bool LoadTextureFromMemory(const std::string& key, Texture texture);
72bool LoadTextureFromRGBA(const std::string& key,
73 std::span<const uint8_t> rgbaData,
74 uint32_t width,
75 uint32_t height,
76 TextureFormat format = TextureFormat::RGBA8_UNORM);
77bool UnloadTextureAsset(const std::string& path);
78void UnloadAllTextureAssets();
79auto AcquireTextureAsset(const std::string& path) -> TextureView;
80auto AcquireTextureAsset(AssetId id) -> TextureView;
81
85bool LoadSkeletalAnimationAsset(const std::string& path);
86bool LoadSkeletalAnimationAssets(std::span<const std::string> paths);
87bool UnloadSkeletalAnimationAsset(const std::string& path);
88void UnloadAllSkeletalAnimationAssets();
89auto AcquireSkeletalAnimationAsset(const std::string& path) -> SkeletalAnimationView;
90auto AcquireSkeletalAnimationAsset(AssetId id) -> SkeletalAnimationView;
91
93bool LoadFont(const FontInfo& font);
94bool LoadFonts(std::span<const FontInfo> font);
95bool UnloadFont(const FontInfo& font);
96void UnloadAllFonts();
97auto AcquireFont(const FontInfo& font) -> FontView;
98} // namespace nc::asset
TextureFormat
Texture formats.
Definition: AssetType.h:37
bool LoadFont(const FontInfo &font)
bool LoadSkeletalAnimationAsset(const std::string &path)
bool LoadMeshAsset(const std::string &path)
bool LoadMeshColliderAsset(const std::string &path)
bool LoadAudioClipAsset(const std::string &path)
bool LoadCubeMapAsset(const std::string &path)
bool LoadTextureAsset(const std::string &path)
bool LoadConvexHullAsset(const std::string &path)
Definition: AssetViews.h:25
Definition: AssetViews.h:33
Definition: AssetViews.h:44
Definition: AssetViews.h:109
Definition: AssetViews.h:115
Definition: AssetViews.h:61
Definition: AssetViews.h:51
Definition: AssetViews.h:103
Definition: Assets.h:133
Definition: AssetViews.h:66