Closed AceKiron closed 5 years ago
nvm got it working, had to just do
glBindTexture(GL_TEXTURE_2D, FTAtlas->id);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, FTAtlas->width, FTAtlas->height, 0, GL_RED, GL_UNSIGNED_BYTE, FTAtlas->data);
texture_font_get_glyph(FTFont, new char('A'));
is a memory leak; you should do
texture_font_get_glyph(FTFont, "A");
freetype-gl uses utf-8 charset, which may cost more than one character for each glyph, thus you should pass a string which corresponds to the utf-32 codepoint of the glyph itself. And inside this repo source files you will also find a way to iterate each of the codepoints in your utf-8 string.
Already got it fixed
I am following TheCherno's Sparky Game Engine series on youtube (https://www.youtube.com/watch?v=Rsdc6I80aFQ&list=PLlrATfBNZ98fqE45g3jZA_hLGUrD4bo6_&index=25&t=37m34s) but the atlas looks like even after I added a glyph
He did
texture_font_get_glyph(FTFont, 'A');
and I had to dotexture_font_get_glyph(FTFont, new char('A'));
but that's probably just of his being an older version.