pass shader to font

This commit is contained in:
jrkb 2023-05-29 17:50:19 +02:00
parent f26de38913
commit 8f1e73eb6a

View file

@ -27,8 +27,10 @@ void GPUFontAtlasLayerCombo::setup(const ComboIdentifier & identifier,
if(this->settings.bufferTargetType == GL_TEXTURE_2D_ARRAY){ if(this->settings.bufferTargetType == GL_TEXTURE_2D_ARRAY){
fontShader = shaderCatalog->get("font_ta"); fontShader = shaderCatalog->get("font_ta");
}else if(this->settings.bufferTargetType == GL_UNIFORM_BUFFER){ }else if(this->settings.bufferTargetType == GL_UNIFORM_BUFFER){
shaderCatalog->setReplacement("{{CURVES_BUFFER_SIZE}}", "2048");
fontShader = shaderCatalog->get("font_ub"); fontShader = shaderCatalog->get("font_ub");
} }
fontShaderProgram = fontShader->program;
{ {
FT_Error error = FT_Init_FreeType(&library); FT_Error error = FT_Init_FreeType(&library);
@ -40,6 +42,7 @@ void GPUFontAtlasLayerCombo::setup(const ComboIdentifier & identifier,
ofxGPUFont::initializeFont(library, ofxGPUFont::initializeFont(library,
this->identifier.fontPath, this->identifier.fontPath,
font, font,
fontShaderProgram,
this->settings.bufferTargetType); this->settings.bufferTargetType);
font->listFontVariationAxes(fontVariationAxesParameters, library); font->listFontVariationAxes(fontVariationAxesParameters, library);
@ -97,6 +100,8 @@ void GPUFontAtlasLayerCombo::update(){
variationText = std::move(_variationText); variationText = std::move(_variationText);
font->prepareGlyphsForText(variationText, font->prepareGlyphsForText(variationText,
library, library,
shaderCatalog,
fontShader,
true); true);
isDirty = false; isDirty = false;
} }