GenImageFontAtlas function added to cgo version as well
This commit is contained in:
parent
8ea76a8e09
commit
893dfa5f85
1 changed files with 10 additions and 0 deletions
|
@ -223,3 +223,13 @@ func GetGlyphAtlasRec(font Font, codepoint int32) Rectangle {
|
||||||
v := newRectangleFromPointer(unsafe.Pointer(&ret))
|
v := newRectangleFromPointer(unsafe.Pointer(&ret))
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GenImageFontAtlas - Generate image font atlas using chars info
|
||||||
|
func GenImageFontAtlas(glyphs []GlyphInfo, glyphRecs []*Rectangle, fontSize int32, padding int32, packMethod int32) Image {
|
||||||
|
cglyphs := (*C.GlyphInfo)(unsafe.Pointer(&glyphs[0]))
|
||||||
|
cglyphRecs := (**C.Rectangle)(unsafe.Pointer(&glyphRecs[0]))
|
||||||
|
cglyphCount := C.int(len(glyphs))
|
||||||
|
ret := C.GenImageFontAtlas(cglyphs, cglyphRecs, cglyphCount, C.int(fontSize), C.int(padding), C.int(packMethod))
|
||||||
|
v := newImageFromPointer(unsafe.Pointer(&ret))
|
||||||
|
return *v
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue