43 lines
1.4 KiB
C++
43 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "AtlasLayerCombo.h"
|
|
#include "MsdfLayer.h"
|
|
#include "Utils.h"
|
|
|
|
namespace ofxVariableLab {
|
|
struct MsdfAtlasLayerComboSettings : public AtlasLayerComboSettings {
|
|
float scale = 64;
|
|
float minimumScale = 64;
|
|
float maxInterpolationStepSize = 50.0;
|
|
};
|
|
class MsdfAtlasLayerCombo : public AtlasLayerCombo {
|
|
public:
|
|
void setup(const ComboIdentifier & identifier,
|
|
const AtlasLayerComboSettings & settings = MsdfAtlasLayerComboSettings()) override;
|
|
void update() override;
|
|
void careForChild(shared_ptr <Layer> layer) override;
|
|
void abandonChild(shared_ptr <Layer> layer) override;
|
|
const ComboIdentifier & getIdentifier() const override;
|
|
void setVFlip(VFlipState vFlipState) override;
|
|
bool hasChildren() override;
|
|
const ofImage & getAtlasImage();
|
|
string getAtlasImagePath();
|
|
shared_ptr <Layer> getLayer(); // TODO: is this used
|
|
shared_ptr <ofxMsdfgen::Atlas> atlas;
|
|
|
|
private:
|
|
MsdfAtlasLayerComboSettings settings;
|
|
vector <shared_ptr <MsdfLayer> > layers;
|
|
vector <ofxMsdfgen::GlyphGeometry> glyphGeometries;
|
|
shared_ptr <ofShader> msdfShader;
|
|
VFlipState vFlip;
|
|
ComboIdentifier identifier;
|
|
bool isDirty = false;
|
|
float scaleFactor = 1.0;
|
|
|
|
GLuint uboName;
|
|
GLint uboIndex;
|
|
void setupUbo();
|
|
bool uboIsSetup = false;
|
|
};
|
|
}
|