fix: .gitignore + add 44 language JSON files
This commit is contained in:
1 parent
e8fd68e27b
commit
8de545dd2c
227 files changed
+22603
No files matched your search
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <d3d11.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct AssetManager AssetManager;
|
||||
typedef struct Asset Asset;
|
||||
|
||||
typedef enum {
|
||||
ASSET_MESH = 0,
|
||||
ASSET_TEXTURE,
|
||||
ASSET_SHADER,
|
||||
ASSET_MATERIAL,
|
||||
ASSET_COUNT
|
||||
} AssetType;
|
||||
|
||||
struct Asset {
|
||||
uint32_t id;
|
||||
AssetType type;
|
||||
int refcount;
|
||||
char path[256];
|
||||
void* data;
|
||||
void (*destroy)(void* data);
|
||||
Asset* next;
|
||||
struct AssetManager* owner;
|
||||
};
|
||||
|
||||
AssetManager* asset_manager_create(void);
|
||||
void asset_manager_destroy(AssetManager* am);
|
||||
|
||||
Asset* asset_manager_load_mesh(AssetManager* am, ID3D11Device* dev, const char* path);
|
||||
Asset* asset_manager_load_texture(AssetManager* am, ID3D11Device* dev, const char* path);
|
||||
Asset* asset_manager_load_shader(AssetManager* am, ID3D11Device* dev, const char* vs_path, const char* ps_path);
|
||||
|
||||
Asset* asset_manager_find(AssetManager* am, const char* path);
|
||||
Asset* asset_manager_get(AssetManager* am, uint32_t id);
|
||||
|
||||
void* asset_data(Asset* a);
|
||||
void asset_acquire(Asset* a);
|
||||
void asset_release(Asset* a);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in new issue
Block a user