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