From 3933e7b2bafa14ddced55b2f585aa09213b738fe Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Mon, 27 Mar 2023 18:55:56 +0200 Subject: [PATCH] do not flip glyphs anymore --- src/conversion.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/conversion.cpp b/src/conversion.cpp index 377e7e3..cb9274c 100644 --- a/src/conversion.cpp +++ b/src/conversion.cpp @@ -10,13 +10,16 @@ void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, void ofxMsdfgen::toOfImage(const msdfgen::Bitmap bitmap, ofImage & image){ image.allocate(bitmap.width(), bitmap.height(), OF_IMAGE_COLOR); + image.getTexture().getTextureData().bFlipTexture = true; + cout << + (image.getTexture().getTextureData().bFlipTexture ? "bFlipTexture is true" : "bFlipTexutre? never heard of it") << endl; ofPixels & pixels = image.getPixels(); int w = bitmap.width(); int h = bitmap.height(); // TODO: why do we need to flip? - for(int y = 1; y <= h; y++){ + for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ - const float * rgb = bitmap(x, h - y); + const float * rgb = bitmap(x, y); int index = 3 * (x + y * w); pixels.getData()[index] = (unsigned char)std::clamp(rgb[0] * 256.0, 0.0, 255.0);