Free up texture data when using renderer_null.

This commit is contained in:
bkaradzic 2012-08-12 22:08:18 -07:00
parent b86fb4cb56
commit 2b1e6790fa

View File

@ -105,8 +105,23 @@ namespace bgfx
{ {
} }
void Context::rendererCreateTexture(TextureHandle /*_handle*/, Memory* /*_mem*/, uint32_t /*_flags*/) void Context::rendererCreateTexture(TextureHandle /*_handle*/, Memory* _mem, uint32_t /*_flags*/)
{ {
StreamRead stream(_mem->data, _mem->size);
uint32_t magic;
stream.read(magic);
if (BGFX_MAGIC == magic)
{
TextureInfo ti;
stream.read(ti);
if (NULL != ti.m_mem)
{
release(ti.m_mem);
}
}
} }
void Context::rendererUpdateTexture(TextureHandle /*_handle*/, uint8_t /*_mip*/, const Rect& /*_rect*/, const Memory* /*_mem*/) void Context::rendererUpdateTexture(TextureHandle /*_handle*/, uint8_t /*_mip*/, const Rect& /*_rect*/, const Memory* /*_mem*/)