remove unnecessary gpuTextureOffset

This commit is contained in:
jrkb 2023-05-29 09:41:51 +02:00
parent d89034e540
commit 45240df10c

View file

@ -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. // 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. // 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), face(face),
hinting(hinting), hinting(hinting),
worldSize(worldSize), worldSize(worldSize){
gpuTextureOffset(gpuTextureOffset){
// TODO: modularize init, so we can initialize with settings and text // TODO: modularize init, so we can initialize with settings and text
@ -743,9 +742,6 @@ class Font {
bool initializedGlyphsBufferTexture = false; bool initializedGlyphsBufferTexture = false;
bool initializedCurvesBufferTexture = false; bool initializedCurvesBufferTexture = false;
bool dirtyBuffers = false; bool dirtyBuffers = false;
int calcTextureOffset(){
return gpuTextureOffset * 2;
}
void testGL(GLuint texture = 10){ void testGL(GLuint texture = 10){
//int size = 0; //int size = 0;
//glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); //glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size);
@ -1443,12 +1439,10 @@ class Font {
// The glyph quads are expanded by this amount to enable proper // The glyph quads are expanded by this amount to enable proper
// anti-aliasing. Value is relative to emSize. // anti-aliasing. Value is relative to emSize.
float dilation = 0; float dilation = 0;
int gpuTextureOffset = 0;
}; };
static std::shared_ptr <Font> loadFont(FT_Library & library, static std::shared_ptr <Font> loadFont(FT_Library & library,
const std::string & filename, const std::string & filename,
int gpuTextureOffset = 0,
float worldSize = 1.0f, float worldSize = 1.0f,
bool hinting = false){ bool hinting = false){
std::string error; std::string error;
@ -1460,16 +1454,15 @@ static std::shared_ptr <Font> loadFont(FT_Library & library,
std::cout << "ofxGPUFont::font.hpp[" << __LINE__ << "] FT loaded " << filename << ": " << error << std::endl; std::cout << "ofxGPUFont::font.hpp[" << __LINE__ << "] FT loaded " << filename << ": " << error << std::endl;
} }
return std::make_shared <Font>(face, gpuTextureOffset, worldSize, hinting); return std::make_shared <Font>(face, worldSize, hinting);
} }
static void initializeFont(FT_Library & library, static void initializeFont(FT_Library & library,
const std::string & filename, const std::string & filename,
shared_ptr <Font> & mainFont, shared_ptr <Font> & mainFont){
int gpuTextureOffset){
cout << "initializeFont" << endl; cout << "initializeFont" << endl;
auto font = loadFont(library, filename, gpuTextureOffset); auto font = loadFont(library, filename);
if(!font){ if(!font){
return; return;
} }