57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
|
|
||
|
#ifndef TC_ASSETS_H
|
||
|
#define TC_ASSETS_H
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
#include <stdint.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
typedef struct tc_asset_attribute
|
||
|
{
|
||
|
char *issuer;
|
||
|
char *name;
|
||
|
|
||
|
union
|
||
|
{
|
||
|
void *pointer;
|
||
|
int64_t integer;
|
||
|
char *text;
|
||
|
|
||
|
} data;
|
||
|
|
||
|
} tc_asset_attribute_s;
|
||
|
|
||
|
typedef struct tc_image
|
||
|
{
|
||
|
uint32_t gl_identifier;
|
||
|
|
||
|
uint32_t len_name;
|
||
|
char *name;
|
||
|
|
||
|
uint32_t attributes_capacity;
|
||
|
uint32_t num_attributes;
|
||
|
tc_asset_attribute_s *attributes;
|
||
|
|
||
|
uint32_t width;
|
||
|
uint32_t height;
|
||
|
void *pixels;
|
||
|
|
||
|
} tc_image_s;
|
||
|
|
||
|
typedef struct tc_asset_storage
|
||
|
{
|
||
|
uint32_t images_capacity;
|
||
|
uint32_t num_images;
|
||
|
tc_image_s **images;
|
||
|
|
||
|
// todo: meshes
|
||
|
|
||
|
} tc_asset_storage_s;
|
||
|
|
||
|
tc_asset_storage_s tc_init_asset_storage (char *asset_folder_path);
|
||
|
tc_image_s * tc_load_image_from_disk (char *path);
|
||
|
void tc_upload_image (tc_image_s *image);
|
||
|
|
||
|
#endif
|
||
|
|