#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(int width = 0, int height = 0) 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 const unordered_map > & getLayers(); shared_ptr getLayer(const LayerID & layerID); const unordered_map > & getAtlasLayerCombos() const; void setVFlip(bool vFlip); void setLayerOrder(const vector & layerOrder); private: VFlipState vFlipState = V_FLIP_UNKNOWN; unordered_map > layers; unordered_map > layerIDcombos; unordered_map > atlasLayerCombos; vector 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 > layers; }; }