summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/texturemanager.cpp
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-02 00:31:40 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-13 15:51:15 +0100
commit3172371fcd26285582a8595dd0b5d5d9193fcf4c (patch)
tree098668a732844d61ba60a1b32b6b66c658450967 /src/osd/modules/render/bgfx/texturemanager.cpp
parentdb72f23b7c31eb8eea969c31926bc25cca072864 (diff)
More work on bgfx data-driven shaders, nw
Diffstat (limited to 'src/osd/modules/render/bgfx/texturemanager.cpp')
-rw-r--r--src/osd/modules/render/bgfx/texturemanager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/osd/modules/render/bgfx/texturemanager.cpp b/src/osd/modules/render/bgfx/texturemanager.cpp
index 4da872978dd..65318bb0e71 100644
--- a/src/osd/modules/render/bgfx/texturemanager.cpp
+++ b/src/osd/modules/render/bgfx/texturemanager.cpp
@@ -18,7 +18,7 @@ texture_manager::~texture_manager()
{
for (std::pair<std::string, bgfx_texture*> texture : m_textures)
{
- if (!(texture.second)->is_target())
+ if (texture.second != nullptr && !(texture.second)->is_target())
{
delete texture.second;
}
@@ -33,7 +33,7 @@ void texture_manager::add_texture(std::string name, bgfx_texture* texture)
bgfx_texture* texture_manager::create_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags)
{
- bgfx_texture* texture = new bgfx_texture(name, format, width, height, data, flags);
+ bgfx_texture* texture = new bgfx_texture(name, format, width, height, flags, data);
m_textures[name] = texture;
return texture;
}