MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / RenderCharacterToConsole

Function RenderCharacterToConsole

Source/Graphics/text.cpp:174–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void RenderCharacterToConsole(int face_id, uint32_t character) {
175 FontRenderer* font_renderer = FontRenderer::Instance();
176 FT_GlyphSlot slot = font_renderer->RenderCharacterBitmap(face_id, character, FontRenderer::RCB_RENDER);
177 FT_Bitmap& bitmap = slot->bitmap;
178 for (int i = 0; i < bitmap.rows; ++i) {
179 int index = i * bitmap.width;
180 for (int j = 0; j < bitmap.width; ++j) {
181 printf("%d", bitmap.buffer[index + j] / 26);
182 }
183 printf("\n");
184 }
185}
186
187TextureRef CreateTextureFromBGRABlock(const TextCanvas::MemoryBlock& bgra_block, int width, int height) {
188 TextureRef texture_ref = Textures::Instance()->makeTexture(width, height, GL_RGBA, GL_RGBA, true);

Callers

nothing calls this directly

Calls 1

RenderCharacterBitmapMethod · 0.80

Tested by

no test coverage detected