From 9ebbcfc4a346972d4dca67b37298292a3cb14b31 Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Fri, 22 Apr 2016 16:49:18 -0400 Subject: [PATCH] Fix issue where the PostProcessor class would sometimes be reconstructed. --- src/PostProcessor.cpp | 6 ++++++ src/PostProcessor.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/PostProcessor.cpp b/src/PostProcessor.cpp index 056324aa..4ce2594c 100644 --- a/src/PostProcessor.cpp +++ b/src/PostProcessor.cpp @@ -24,6 +24,10 @@ #define FRAGMENT_SHADER_END "\n" #endif +#ifdef ANDROID +PostProcessor PostProcessor::processor; +#endif + static const char * vertexShader = SHADER_VERSION "#if (__VERSION__ > 120) \n" @@ -469,7 +473,9 @@ void PostProcessor::destroy() PostProcessor & PostProcessor::get() { +#ifndef ANDROID static PostProcessor processor; +#endif return processor; } diff --git a/src/PostProcessor.h b/src/PostProcessor.h index 73f22557..12020bdf 100644 --- a/src/PostProcessor.h +++ b/src/PostProcessor.h @@ -18,6 +18,7 @@ public: private: PostProcessor(); PostProcessor(const PostProcessor & _other); + void _initCommon(); void _destroyCommon(); void _initGammaCorrection(); @@ -43,6 +44,10 @@ private: CachedTexture * m_pTextureOriginal; CachedTexture * m_pTextureGlowMap; CachedTexture * m_pTextureBlur; + +#ifdef ANDROID + static PostProcessor processor; +#endif }; #endif // POST_PROCESSOR_H