Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 377d3bc

Browse files
committed
add class static variable for EffectOutline
1 parent d4913bf commit 377d3bc

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@ void EffectSprite3D::addEffect(Effect3DOutline* effect, ssize_t order)
264264
std::sort(std::begin(_effects), std::end(_effects), tuple_sort);
265265
}
266266

267+
const std::string Effect3DOutline::_vertShaderFile = "Shaders3D/OutLine.vert";
268+
const std::string Effect3DOutline::_fragShaderFile = "Shaders3D/OutLine.frag";
269+
//GLProgram* Effect3DOutline::getorCreateProgram()
270+
//{
271+
// return nullptr;
272+
//}
273+
267274
Effect3DOutline* Effect3DOutline::create()
268275
{
269276
Effect3DOutline* effect = new Effect3DOutline();
@@ -282,7 +289,7 @@ Effect3DOutline* Effect3DOutline::create()
282289
bool Effect3DOutline::init()
283290
{
284291

285-
GLProgram* glprogram = GLProgram::createWithFilenames("Shaders3D/OutLine.vert", "Shaders3D/OutLine.frag");
292+
GLProgram* glprogram = GLProgram::createWithFilenames(_vertShaderFile, _fragShaderFile);
286293
if(nullptr == glprogram)
287294
{
288295
CC_SAFE_DELETE(glprogram);

tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ class Effect3DOutline: public Effect3D
9797
Vec3 _outlineColor;
9898
float _outlineWidth;
9999

100+
public:
101+
static const std::string _vertShaderFile;
102+
static const std::string _fragShaderFile;
103+
//static GLProgram* getorCreateProgram();
100104
};
101105

102106
class EffectSprite3D : public Sprite3D

0 commit comments

Comments
 (0)