Blender V4.3
StrokeRenderer.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2008-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#include "StrokeRenderer.h"
11
13
14#include "BLI_sys_types.h"
15
16using namespace std;
17
18namespace Freestyle {
19
20/**********************************/
21/* */
22/* */
23/* StrokeRenderer */
24/* */
25/* */
26/**********************************/
27
28TextureManager *StrokeRenderer::_textureManager = nullptr;
29
31
33{
35 return true;
36}
37
38/**********************************/
39/* */
40/* */
41/* TextureManager */
42/* */
43/* */
44/**********************************/
45
47
49
51
58
60{
61 if (!_brushesMap.empty()) {
62 _brushesMap.clear();
63 }
64 _pInstance = nullptr;
65}
66
68{
70 return;
71 }
73 _hasLoadedTextures = true;
74}
75
77{
78 BrushTexture bt(name, iType);
79 brushesMap::iterator b = _brushesMap.find(bt);
80 if (b == _brushesMap.end()) {
81 uint texId = loadBrush(name, iType);
82 _brushesMap[bt] = texId;
83 return texId;
84 // XXX!
85 cerr << "brush file " << name << " not found" << endl;
86 return 0;
87 }
88
89 return _brushesMap[bt];
90}
91
93{
94 _patterns_path = path;
95}
96
101
103{
104 _brushes_path = path;
105}
106
111
112} /* namespace Freestyle */
unsigned int uint
Various tools for geometry.
Classes to render a stroke with OpenGL.
static TextureManager * _textureManager
virtual uint loadBrush(string fileName, Stroke::MediumType=Stroke::OPAQUE_MEDIUM)=0
virtual void loadStandardBrushes()=0
static TextureManager * _pInstance
uint getBrushTextureIndex(string name, Stroke::MediumType iType=Stroke::OPAQUE_MEDIUM)
std::pair< string, Stroke::MediumType > BrushTexture
local_group_size(16, 16) .push_constant(Type b
inherits from class Rep
Definition AppCanvas.cpp:20
static void setPatternsPath(const string &path)
static void setBrushesPath(const string &path)