#pragma once #include "ofMain.h" #include "AtlasLayerCombo.h" #include "MsdfAtlasLayerCombo.h" #include "MsdfLayer.h" #include "GPUFontAtlasLayerCombo.h" #include "GPUFontLayer.h" #include "Utils.h" namespace ofxVariableLab { class LayerComposition { public: void setup(); void update(); void draw() const; LayerID addLayer(const Layer::Props & props, LayerID layerID = ""); LayerID addLayer(const ComboIdentifier & identifier, const string & text, const std::vector & variations, LayerID layerID = ""); LayerID addLayer(const ComboIdentifier & identifier, const Layer::Props & props, const std::vector & variations, LayerID layerID = ""); void findOrCreateNewMomForLayer(shared_ptr layer, ComboIdentifier idealMom); void removeLayer(const LayerID & id); // TODO: make bool, to catch nonexisting shared_ptr getLayer(const LayerID & layerID); const unordered_map > & getAtlasLayerCombos() const; void setVFlip(bool vFlip); private: VFlipState vFlipState = V_FLIP_UNKNOWN; unordered_map > layers; unordered_map > atlasLayerCombos; /** * @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 > layers; }; }