Moved ctor/dtor into init/shutdown to have class ctor fully initialized prior calling initialization code.

This commit is contained in:
Branimir Karadžić
2014-10-13 21:14:51 -07:00
parent 3b01df7293
commit bfa1f9f3af
3 changed files with 33 additions and 3 deletions

View File

@@ -852,6 +852,14 @@ namespace bgfx
, m_hash( (BX_PLATFORM_WINDOWS<<1) | BX_ARCH_64BIT)
, m_backBufferFbo(0)
, m_msaaBackBufferFbo(0)
{
}
~RendererContextGL()
{
}
void init()
{
m_fbh.idx = invalidHandle;
memset(m_uniforms, 0, sizeof(m_uniforms) );
@@ -1349,7 +1357,7 @@ namespace bgfx
}
}
~RendererContextGL()
void shutdown()
{
if (m_vaoSupport)
{
@@ -2305,11 +2313,13 @@ namespace bgfx
RendererContextI* rendererCreateGL()
{
s_renderGL = BX_NEW(g_allocator, RendererContextGL);
s_renderGL->init();
return s_renderGL;
}
void rendererDestroyGL()
{
s_renderGL->shutdown();
BX_DELETE(g_allocator, s_renderGL);
s_renderGL = NULL;
}