mirror of https://github.com/axmolengine/axmol.git
using lambda function instead of member function
This commit is contained in:
parent
30f4f256d8
commit
2084fc4ddc
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue