mirror of https://github.com/axmolengine/axmol.git
* [WP8] Enabled GLProgramState restoring on render recreated
This commit is contained in:
parent
e5ac916a17
commit
bfe83e5624
|
@ -279,7 +279,7 @@ GLProgramState::GLProgramState()
|
|||
, _textureUnitIndex(1)
|
||||
, _uniformAttributeValueDirty(true)
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
|
||||
/** listen the event that renderer was recreated on Android/WP8 */
|
||||
CCLOG("create rendererRecreatedListener for GLProgramState");
|
||||
_backToForegroundlistener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { _uniformAttributeValueDirty = true; });
|
||||
|
@ -289,7 +289,7 @@ GLProgramState::GLProgramState()
|
|||
|
||||
GLProgramState::~GLProgramState()
|
||||
{
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
|
||||
Director::getInstance()->getEventDispatcher()->removeEventListener(_backToForegroundlistener);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -217,8 +217,8 @@ protected:
|
|||
int _textureUnitIndex;
|
||||
uint32_t _vertexAttribsFlags;
|
||||
GLProgram *_glprogram;
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
|
||||
EventListenerCustom* _backToForegroundlistener;
|
||||
#endif
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue