#define STBTT_free __onyx_heap_free_wrapper
#define STB_TRUETYPE_IMPLEMENTATION
+#define STB_RECT_PACK_IMPLEMENTATION
#include "stb_rect_pack.h"
#include "stb_truetype.h"
--- /dev/null
+package stb_truetype
+
+#library "stb_truetype"
+
+stbtt_pack_context :: struct #size 64 {}
+
+stbtt_packedchar :: struct #size 28 {
+ x0, y0, x1, y1: u16;
+ xoff, yoff, xadvance: f32;
+ xoff2, yoff2: f32;
+}
+
+#foreign "stb_truetype" {
+ stbtt_PackBegin :: (ctx: ^stbtt_pack_context, pixels: ^u8, width, height, stride_in_bytes, padding: i32) -> i32 ---
+ stbtt_PackEnd :: (ctx: ^stbtt_pack_context) -> void ---
+ stbtt_PackFontRange :: (ctx: ^stbtt_pack_context, fontdata: ^u8, font_index: i32, font_size: f32, first_unicode_char_in_range: i32, num_chars_in_range: i32, chardata_for_range: ^stbtt_packedchar) -> i32 ---
+ stbtt_PackSetOversampling :: (ctx: ^stbtt_pack_context, h_oversample, v_oversample: i32) -> void ---
+}
+
+#export "stbtt_heap_alloc" (size: i32) -> rawptr {
+ return calloc(size);
+}
+
+#export "stbtt_heap_free" (ptr: rawptr) {
+ cfree(ptr);
+}
\ No newline at end of file
#library_path "./lib"
#load "glfw3/module"
-#load "opengles/module"
\ No newline at end of file
+#load "opengles/module"
+
+#load "./../lib/stb_truetype"
\ No newline at end of file