This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
MainTree/core/exports/maintree/maintree.h

57 lines
1.8 KiB
C

// Exported functions of MainTree
#ifndef MAINTREE_H
#define MAINTREE_H
#include <librr/types.h>
#include <librr/linear_algebra.h>
typedef enum
{
MT_TAG_NONEXISTENT,
MT_TAG_INT,
MT_TAG_REAL,
MT_TAG_STRING,
MT_TAG_POINTER,
MT_TAG_VEC2,
MT_TAG_VEC3,
MT_TAG_VEC4
} MtTagType;
typedef void MtEntity;
typedef void MtState;
typedef bool_t (*MtQueryMatcherFn) (MtEntity *entity, void *userdata);
MtState * mt_initialize(char *app_name);
void mt_cleanup(MtState *state);
void mt_start(MtState *state);
MtEntity * mt_summon(MtState *state);
void mt_drop(MtEntity *entity);
usz_t mt_query(MtState *state, const char **tags, MtEntity **entities, usz_t count);
usz_t mt_match_query(MtState *state, const char **tags, MtEntity **entities, usz_t count, MtQueryMatcherFn matcher, void *userdata);
void mt_tag_i64(MtEntity *entity, char *name, i64_t integer);
void mt_tag_f64(MtEntity *entity, char *name, f64_t real);
void mt_tag_str(MtEntity *entity, char *name, char *string);
void mt_tag_ptr(MtEntity *entity, char *name, void *pointer);
void mt_tag_vec2(MtEntity *entity, char *name, rr_vec2f_s vector);
void mt_tag_vec3(MtEntity *entity, char *name, rr_vec3f_s vector);
void mt_tag_vec4(MtEntity *entity, char *name, rr_vec4f_s vector);
MtTagType mt_get_tag_type(MtEntity *entity, char *name);
bool_t mt_has_tag(MtEntity *entity, const char *name);
void mt_untag(MtEntity *entity, char *name);
i64_t mt_get_i64_tag(MtEntity *entity, char *name);
f64_t mt_get_f64_tag(MtEntity *entity, char *name);
char * mt_get_str_tag(MtEntity *entity, char *name);
void * mt_get_ptr_tag(MtEntity *entity, char *name);
rr_vec2f_s mt_get_vec2_tag(MtEntity *entity, char *name);
rr_vec3f_s mt_get_vec3_tag(MtEntity *entity, char *name);
rr_vec4f_s mt_get_vec4_tag(MtEntity *entity, char *name);
#endif // MAINTREE_H