24 #include "../geometry/GeomUtils.h"
38 TextureManager *StrokeRenderer::_textureManager =
nullptr;
40 StrokeRenderer::~StrokeRenderer() =
default;
42 bool StrokeRenderer::loadTextures()
44 _textureManager->load();
58 string TextureManager::_patterns_path;
60 string TextureManager::_brushes_path;
62 TextureManager::TextureManager()
64 _hasLoadedTextures =
false;
66 _defaultTextureId = 0;
69 TextureManager::~TextureManager()
71 if (!_brushesMap.empty()) {
79 if (_hasLoadedTextures) {
82 loadStandardBrushes();
83 _hasLoadedTextures =
true;
89 brushesMap::iterator b = _brushesMap.find(bt);
90 if (b == _brushesMap.end()) {
91 unsigned texId = loadBrush(name, iType);
92 _brushesMap[bt] = texId;
95 cerr <<
"brush file " << name <<
" not found" << endl;
99 return _brushesMap[bt];
102 void TextureManager::Options::setPatternsPath(
const string &path)
104 _patterns_path = path;
107 string TextureManager::Options::getPatternsPath()
109 return _patterns_path;
112 void TextureManager::Options::setBrushesPath(
const string &path)
114 _brushes_path = path;
117 string TextureManager::Options::getBrushesPath()
119 return _brushes_path;
Classes to render a stroke with OpenGL.
std::pair< string, Stroke::MediumType > BrushTexture
int load(istream &in, Vec3r &v)