using lambda function instead of member function

This commit is contained in:
Huabing.Xu 2014-05-28 15:50:37 +08:00
parent 30f4f256d8
commit 2084fc4ddc
2 changed files with 1 additions and 8 deletions

View File

@ -281,17 +281,11 @@ GLProgramState::GLProgramState()
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
// listen the event when app go to foreground
CCLOG("create _backToForegroundlistener for GLProgramState");
_backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(GLProgramState::setProgramStateDirty, this));
_backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { _uniformAttributeValueDirty = true; });
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1);
#endif
}
void GLProgramState::setProgramStateDirty(EventCustom *event)
{
CCLOG("GLProgramState to background---------");
_uniformAttributeValueDirty = true;
}
GLProgramState::~GLProgramState()
{
CC_SAFE_RELEASE(_glprogram);

View File

@ -185,7 +185,6 @@ protected:
~GLProgramState();
bool init(GLProgram* program);
void resetGLProgram();
void setProgramStateDirty(EventCustom* event);
VertexAttribValue* getVertexAttribValue(const std::string &attributeName);
UniformValue* getUniformValue(const std::string &uniformName);