diff --git a/doc/notes/3.1.6.md b/doc/notes/3.1.6.md index eba18591cb..12f4f3eaf7 100644 --- a/doc/notes/3.1.6.md +++ b/doc/notes/3.1.6.md @@ -14,6 +14,7 @@ This build includes the following changes: - Added `Configuration` setting to disable function lookup checks. - par_shapes: Patched to support 32-bit indices and extremely dense meshes. +- stb_truetype: Exposed members of internal structures for advanced glyph packing customization. - Tootle: Now supports the Direct3D rasterizer for overdraw optimization. #### Fixes @@ -26,4 +27,5 @@ This build includes the following changes: #### Breaking Changes -- par_shapes: Changed `par_shapes_mesh::triangles` from `uint16_t/ShortBuffer` to `uint32_t/IntBuffer`. \ No newline at end of file +- par_shapes: Changed `par_shapes_mesh::triangles` from `uint16_t/ShortBuffer` to `uint32_t/IntBuffer`. +- stb_rect_pack: `stbrp_rect::was_packed` is now mapped to Java `boolean`. \ No newline at end of file diff --git a/modules/templates/src/main/kotlin/org/lwjgl/stb/STBTypes.kt b/modules/templates/src/main/kotlin/org/lwjgl/stb/STBTypes.kt index 36fc880a2b..2377f7948f 100644 --- a/modules/templates/src/main/kotlin/org/lwjgl/stb/STBTypes.kt +++ b/modules/templates/src/main/kotlin/org/lwjgl/stb/STBTypes.kt @@ -139,12 +139,6 @@ val stbi_write_func = "stbi_write_func *".callback( val stbrp_coord = typedef(unsigned_short, "stbrp_coord") // int is also supported if STBRP_LARGE_RECTS is defined -val stbrp_context_p = struct(STB_PACKAGE, "STBRPContext", nativeName = "stbrp_context", mutable = false) { - documentation = "The opaque {@code stbrp_context} struct." - includeSTBAPI("#include \"stb_rect_pack.h\"") - static(STB_LIBRARY) -}.p - val stbrp_rect_p = struct(STB_PACKAGE, "STBRPRect", nativeName = "stbrp_rect") { documentation = "A packed rectangle." @@ -153,13 +147,30 @@ val stbrp_rect_p = struct(STB_PACKAGE, "STBRPRect", nativeName = "stbrp_rect") { stbrp_coord.member("h", "input height") stbrp_coord.member("x", "output x coordinate") stbrp_coord.member("y", "output y coordinate") - int.member("was_packed", "non-zero if valid packing") + intb.member("was_packed", "non-zero if valid packing") }.p -val stbrp_node_p = struct(STB_PACKAGE, "STBRPNode", nativeName = "stbrp_node") { +val stbrp_node_p = struct(STB_PACKAGE, "STBRPNode", nativeName = "stbrp_node").p +val stbrp_node = struct(STB_PACKAGE, "STBRPNode", nativeName = "stbrp_node", mutable = false) { documentation = "The opaque {@code stbrp_node} struct." - includeSTBAPI("#include \"stb_rect_pack.h\"") - static(STB_LIBRARY) + + stbrp_coord.member("x", "") + stbrp_coord.member("y", "") + nullable..stbrp_node_p.member("next", "") +} + +val stbrp_context_p = struct(STB_PACKAGE, "STBRPContext", nativeName = "stbrp_context", mutable = false) { + documentation = "The opaque {@code stbrp_context} struct." + + int.member("width", "") + int.member("height", "") + int.member("align", "") + int.member("init_mode", "") + int.member("heuristic", "") + int.member("num_nodes", "") + nullable..stbrp_node_p.member("active_head", "") + nullable..stbrp_node_p.member("free_head", "") + stbrp_node.array("extra", "we allocate two extra nodes so optimal user-node-count is {@code width} not {@code width+2}", size = 2) }.p // stb_truetype.h @@ -191,11 +202,20 @@ val stbtt_aligned_quad_p = struct(STB_PACKAGE, "STBTTAlignedQuad", nativeName = val stbtt_pack_context_p = struct(STB_PACKAGE, "STBTTPackContext", nativeName = "stbtt_pack_context", mutable = false) { documentation = "An opaque structure which holds all the context needed from #PackBegin() to #PackEnd()." - includeSTBAPI("#include \"stb_truetype.h\"") - static(STB_LIBRARY) + + nullable..opaque_p.member("user_allocator_context", "") + stbrp_context_p.member("pack_info", "") + int.member("width", "") + int.member("height", "") + int.member("stride_in_bytes", "") + int.member("padding", "") + unsigned_int.member("h_oversample", "") + unsigned_int.member("v_oversample", "") + unsigned_char_p.member("pixels", "") + stbrp_node_p.buffer("nodes", "") }.p -val stbtt_packedchar_p = struct(STB_PACKAGE, "STBTTPackedchar", nativeName = "stbtt_packedchar", mutable = false) { +val stbtt_packedchar_p = struct(STB_PACKAGE, "STBTTPackedchar", nativeName = "stbtt_packedchar") { documentation = "Packed character data, returned by #PackFontRange()" unsigned_short.member("x0", "")