remove unnecessary gpuTextureOffset
This commit is contained in:
parent
922566f597
commit
8a1497fb4f
4 changed files with 1 additions and 13 deletions
|
@ -35,8 +35,7 @@ void GPUFontAtlasLayerCombo::setup(const ComboIdentifier & identifier,
|
||||||
}
|
}
|
||||||
ofxGPUFont::initializeFont(library,
|
ofxGPUFont::initializeFont(library,
|
||||||
this->identifier.fontPath,
|
this->identifier.fontPath,
|
||||||
font,
|
font);
|
||||||
this->settings.gpuTextureOffset);
|
|
||||||
|
|
||||||
font->listFontVariationAxes(fontVariationAxesParameters, library);
|
font->listFontVariationAxes(fontVariationAxesParameters, library);
|
||||||
//cout << this->identifier.fontPath << " : fontVariationAxes :" << endl;
|
//cout << this->identifier.fontPath << " : fontVariationAxes :" << endl;
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
namespace ofxVariableLab {
|
namespace ofxVariableLab {
|
||||||
|
|
||||||
struct GPUFontAtlasLayerComboSettings : public AtlasLayerComboSettings {
|
struct GPUFontAtlasLayerComboSettings : public AtlasLayerComboSettings {
|
||||||
int gpuTextureOffset = 0;
|
|
||||||
};
|
};
|
||||||
class GPUFontAtlasLayerCombo : public AtlasLayerCombo {
|
class GPUFontAtlasLayerCombo : public AtlasLayerCombo {
|
||||||
struct Transform {
|
struct Transform {
|
||||||
|
|
|
@ -44,9 +44,7 @@ void LayerComposition::findOrCreateNewMomForLayer(shared_ptr <Layer> layer,
|
||||||
case LayerType::GPUFONT: {
|
case LayerType::GPUFONT: {
|
||||||
auto combo = make_shared <GPUFontAtlasLayerCombo>();
|
auto combo = make_shared <GPUFontAtlasLayerCombo>();
|
||||||
GPUFontAtlasLayerComboSettings settings;
|
GPUFontAtlasLayerComboSettings settings;
|
||||||
settings.gpuTextureOffset = nextGpuTextureOffset;
|
|
||||||
combo->setup(idealMom, settings);
|
combo->setup(idealMom, settings);
|
||||||
nextGpuTextureOffset++;
|
|
||||||
combo->careForChild(layer);
|
combo->careForChild(layer);
|
||||||
atlasLayerCombos[idealMom] = std::move(combo);
|
atlasLayerCombos[idealMom] = std::move(combo);
|
||||||
break;
|
break;
|
||||||
|
@ -105,9 +103,7 @@ LayerID LayerComposition::addLayer(const ComboIdentifier & identifier,
|
||||||
// so let's create it
|
// so let's create it
|
||||||
combo = make_shared <GPUFontAtlasLayerCombo>();
|
combo = make_shared <GPUFontAtlasLayerCombo>();
|
||||||
GPUFontAtlasLayerComboSettings settings;
|
GPUFontAtlasLayerComboSettings settings;
|
||||||
settings.gpuTextureOffset = nextGpuTextureOffset;
|
|
||||||
combo->setup(identifier, settings);
|
combo->setup(identifier, settings);
|
||||||
nextGpuTextureOffset++;
|
|
||||||
atlasLayerCombos[identifier] = combo;
|
atlasLayerCombos[identifier] = combo;
|
||||||
}else{
|
}else{
|
||||||
// use existing combo
|
// use existing combo
|
||||||
|
|
|
@ -41,12 +41,6 @@ class LayerComposition {
|
||||||
unordered_map <ComboIdentifier, shared_ptr <AtlasLayerCombo> > atlasLayerCombos;
|
unordered_map <ComboIdentifier, shared_ptr <AtlasLayerCombo> > atlasLayerCombos;
|
||||||
vector <LayerID> layerOrder;
|
vector <LayerID> layerOrder;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief lastGpuTextureOffset GL_TEXTURE0 + offset
|
|
||||||
* we want to different textures for different fonts
|
|
||||||
* this value is incremented/decremented when adding/removing GPUFont layers
|
|
||||||
*/
|
|
||||||
int nextGpuTextureOffset = 0;
|
|
||||||
//unordered_map <LayerIdentifier, shared_ptr <ofxVariableLab::Layer> > layers;
|
//unordered_map <LayerIdentifier, shared_ptr <ofxVariableLab::Layer> > layers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue