pawengine/main.c

43 lines
995 B
C
Raw Normal View History

2025-02-25 18:07:03 +01:00
#include "src/comp.h"
#include "src/paw_object.h"
2025-02-25 18:07:03 +01:00
#include "src/register.h"
2025-02-09 18:48:25 +01:00
#include "trig.c"
2025-04-07 23:24:42 +02:00
/* #include "src/lang/ast.h" */
/* #include "src/lang/ast_disc.h" */
/* #include "src/lang/parser.h" */
2025-03-01 20:47:43 +01:00
2025-02-09 18:48:25 +01:00
#include <stdbool.h>
int main() {
2025-04-04 18:52:45 +02:00
/* struct PawAST *comp_ast = ast_read("out.paw.bin"); */
/* ast_call(comp_ast, "ready"); */
/* ast_call(comp_ast, "tick"); */
/* ast_call(comp_ast, "free"); */
/* return 0; */
2025-03-01 20:47:43 +01:00
2025-02-09 18:48:25 +01:00
struct Vk *vk;
cat_Comp *state = cat_comp_init("meooow", 500, 500, &vk);
struct Register *reg = make_register();
reg_attatch_type(reg, "trig", OBJ_MAKE make_trig, OBJ_FREE free_trig,
OBJ_TICK trig_tick);
struct PawScene *scene = paw_scene_make(vk, reg);
2025-02-09 18:48:25 +01:00
paw_scene_queue_insert(scene, "trig", trig_make_args(scene));
2025-02-09 18:48:25 +01:00
while (!cat_comp_should_close(state)) {
paw_scene_tick(scene);
2025-02-09 18:48:25 +01:00
cat_comp_draw(state);
}
paw_scene_free(scene);
2025-02-09 18:48:25 +01:00
free_register(reg);
cat_comp_uninit(state);
state = NULL;
reg = NULL;
scene = NULL;
}