From 45240df10ceaa6142cd520b71d3ff4735e020c53 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Mon, 29 May 2023 09:41:51 +0200 Subject: [PATCH] remove unnecessary gpuTextureOffset --- src/gpufont/font.hpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/gpufont/font.hpp b/src/gpufont/font.hpp index 3524366..9ce70db 100644 --- a/src/gpufont/font.hpp +++ b/src/gpufont/font.hpp @@ -429,11 +429,10 @@ class Font { // If hinting is enabled, worldSize must be an integer and defines the font size in pixels used for hinting. // Otherwise, worldSize can be an arbitrary floating-point value. - Font(FT_Face face, int gpuTextureOffset, float worldSize = 1.0f, bool hinting = false) : + Font(FT_Face face, float worldSize = 1.0f, bool hinting = false) : face(face), hinting(hinting), - worldSize(worldSize), - gpuTextureOffset(gpuTextureOffset){ + worldSize(worldSize){ // TODO: modularize init, so we can initialize with settings and text @@ -743,9 +742,6 @@ class Font { bool initializedGlyphsBufferTexture = false; bool initializedCurvesBufferTexture = false; bool dirtyBuffers = false; - int calcTextureOffset(){ - return gpuTextureOffset * 2; - } void testGL(GLuint texture = 10){ //int size = 0; //glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); @@ -1443,12 +1439,10 @@ class Font { // The glyph quads are expanded by this amount to enable proper // anti-aliasing. Value is relative to emSize. float dilation = 0; - int gpuTextureOffset = 0; }; static std::shared_ptr loadFont(FT_Library & library, const std::string & filename, - int gpuTextureOffset = 0, float worldSize = 1.0f, bool hinting = false){ std::string error; @@ -1460,16 +1454,15 @@ static std::shared_ptr loadFont(FT_Library & library, std::cout << "ofxGPUFont::font.hpp[" << __LINE__ << "] FT loaded " << filename << ": " << error << std::endl; } - return std::make_shared (face, gpuTextureOffset, worldSize, hinting); + return std::make_shared (face, worldSize, hinting); } static void initializeFont(FT_Library & library, const std::string & filename, - shared_ptr & mainFont, - int gpuTextureOffset){ + shared_ptr & mainFont){ cout << "initializeFont" << endl; - auto font = loadFont(library, filename, gpuTextureOffset); + auto font = loadFont(library, filename); if(!font){ return; }