|
@@ -740,13 +740,7 @@ namespace bgfx
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- if (NULL != m_capture)
|
|
|
|
|
- {
|
|
|
|
|
- g_callback->captureEnd();
|
|
|
|
|
- BX_FREE(g_allocator, m_capture);
|
|
|
|
|
- m_capture = NULL;
|
|
|
|
|
- m_captureSize = 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ captureFinish();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -767,6 +761,17 @@ namespace bgfx
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ void captureFinish()
|
|
|
|
|
+ {
|
|
|
|
|
+ if (NULL != m_capture)
|
|
|
|
|
+ {
|
|
|
|
|
+ g_callback->captureEnd();
|
|
|
|
|
+ BX_FREE(g_allocator, m_capture);
|
|
|
|
|
+ m_capture = NULL;
|
|
|
|
|
+ m_captureSize = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
void saveScreenShot(const char* _filePath)
|
|
void saveScreenShot(const char* _filePath)
|
|
|
{
|
|
{
|
|
|
uint32_t length = m_resolution.m_width*m_resolution.m_height*4;
|
|
uint32_t length = m_resolution.m_width*m_resolution.m_height*4;
|
|
@@ -825,6 +830,8 @@ namespace bgfx
|
|
|
|
|
|
|
|
void shutdown()
|
|
void shutdown()
|
|
|
{
|
|
{
|
|
|
|
|
+ captureFinish();
|
|
|
|
|
+
|
|
|
invalidateCache();
|
|
invalidateCache();
|
|
|
|
|
|
|
|
#if BGFX_CONFIG_RENDERER_OPENGL
|
|
#if BGFX_CONFIG_RENDERER_OPENGL
|
|
@@ -1103,6 +1110,13 @@ namespace bgfx
|
|
|
|
|
|
|
|
void Program::destroy()
|
|
void Program::destroy()
|
|
|
{
|
|
{
|
|
|
|
|
+ if (NULL != m_constantBuffer)
|
|
|
|
|
+ {
|
|
|
|
|
+ ConstantBuffer::destroy(m_constantBuffer);
|
|
|
|
|
+ m_constantBuffer = NULL;
|
|
|
|
|
+ }
|
|
|
|
|
+ m_numPredefined = 0;
|
|
|
|
|
+
|
|
|
GL_CHECK(glUseProgram(0) );
|
|
GL_CHECK(glUseProgram(0) );
|
|
|
GL_CHECK(glDeleteProgram(m_id) );
|
|
GL_CHECK(glDeleteProgram(m_id) );
|
|
|
|
|
|