idk anymore

This commit is contained in:
Masashi 2025-12-17 18:32:29 +05:30
commit 3257bb449e
19 changed files with 537 additions and 77 deletions

View file

@ -1,53 +0,0 @@
#include "../libsuicmez/libsuicmez.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
void* gc_alloc(const TypeInfo* type, size_t size);
void gc_init(void);
void gc_shutdown(void);
// Helper for allocating arrays
static void* suic_alloc_array(const TypeInfo* type, size_t elem_size, size_t len, void* init_data) {
void* ptr = gc_alloc(type, elem_size * len);
if (init_data) memcpy(ptr, init_data, elem_size * len);
return ptr;
}
// Helper for allocating structs
static void* suic_alloc_struct(const TypeInfo* type, size_t size, void* init_data) {
void* ptr = gc_alloc(type, size);
if (init_data) memcpy(ptr, init_data, size);
return ptr;
}
int suic_main(void);
int suic_main(void) {
suic_init_window(800, 600, suic_alloc_array(NULL, sizeof(char), 5, "Test"));
suic_set_target_fps(60);
while ((suic_window_should_close() == false)) {
suic_begin_drawing();
suic_clear_background(255, 0, 0, 255);
suic_end_drawing();
}
suic_close_window();
return 0;
}
int main(int argc, char* argv[]) {
// Initialize GC
gc_init();
// init globals
// init event loop
int result = suic_main();
// Shutdown GC
gc_shutdown();
return result;
}