forked from organicmaps/organicmaps-tmp
renamed doDeleteOnDestroy into hasContext and added check into OGLCHECK
This commit is contained in:
parent
871012439c
commit
315f177e24
8 changed files with 12 additions and 13 deletions
|
@ -71,11 +71,11 @@ bool ShutdownGLESResources()
|
|||
{
|
||||
NVDEBUG("ShutdownGLESResources: GLES not bound, shutting down EGL to release");
|
||||
|
||||
yg::gl::g_doDeleteOnDestroy = false;
|
||||
yg::gl::g_hasContext = false;
|
||||
|
||||
g_framework->DeleteRenderPolicy();
|
||||
|
||||
yg::gl::g_doDeleteOnDestroy = true;
|
||||
yg::gl::g_hasContext = true;
|
||||
|
||||
NVDEBUG("Cleaning up EGL");
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace yg
|
|||
|
||||
BaseTexture::~BaseTexture()
|
||||
{
|
||||
if (g_doDeleteOnDestroy)
|
||||
if (g_hasContext)
|
||||
OGLCHECK(glDeleteTextures(1, &m_id));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace yg
|
|||
|
||||
FrameBuffer::~FrameBuffer()
|
||||
{
|
||||
if ((m_id != 0) && g_doDeleteOnDestroy)
|
||||
if ((m_id != 0) && g_hasContext)
|
||||
OGLCHECK(glDeleteFramebuffersFn(1, &m_id));
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace yg
|
|||
|
||||
IndexBuffer::~IndexBuffer()
|
||||
{
|
||||
if ((!m_useVA) && (g_doDeleteOnDestroy))
|
||||
if ((!m_useVA) && (g_hasContext))
|
||||
OGLCHECK(glDeleteBuffersFn(1, &m_id));
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace yg
|
|||
|
||||
void (OPENGL_CALLING_CONVENTION * glBlendFuncSeparateFn) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
|
||||
bool g_doDeleteOnDestroy = true;
|
||||
bool g_hasContext = true;
|
||||
bool g_doLogOGLCalls = false;
|
||||
|
||||
void CheckExtensionSupport()
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace yg
|
|||
/// In this case we should set this variable to true to correctly deletes all our wrapper
|
||||
/// classes without calls to glDeleteXXX.
|
||||
|
||||
extern bool g_doDeleteOnDestroy;
|
||||
extern bool g_hasContext;
|
||||
|
||||
/// This flag controls, whether the OGLCHECK macroses should log OGL calls.
|
||||
/// This is for debugging purpose only.
|
||||
|
@ -159,8 +159,7 @@ namespace yg
|
|||
#endif
|
||||
|
||||
#else
|
||||
#define OGLCHECK(f) f
|
||||
#define OGLCHECKAFTER
|
||||
#define EGLCHECK
|
||||
|
||||
#define OGLCHECK(f) f
|
||||
#define OGLCHECKAFTER
|
||||
#define EGLCHECK
|
||||
#endif
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace yg
|
|||
|
||||
RenderBuffer::~RenderBuffer()
|
||||
{
|
||||
if (g_doDeleteOnDestroy)
|
||||
if (g_hasContext)
|
||||
{
|
||||
// if(m_isDepthBuffer)
|
||||
// OGLCHECK(glDeleteTextures(1, &m_id));
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace yg
|
|||
|
||||
VertexBuffer::~VertexBuffer()
|
||||
{
|
||||
if ((!m_useVA) && (g_doDeleteOnDestroy))
|
||||
if ((!m_useVA) && (g_hasContext))
|
||||
OGLCHECK(glDeleteBuffersFn(1, &m_id));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue