summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/texture.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/texture.cpp
parentdb72f23b7c31eb8eea969c31926bc25cca072864 (diff)
More work on bgfx data-driven shaders, nw
Diffstat (limited to 'src/osd/modules/render/bgfx/texture.cpp')
-rw-r--r--src/osd/modules/render/bgfx/texture.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/osd/modules/render/bgfx/texture.cpp b/src/osd/modules/render/bgfx/texture.cpp
index c588fa63b20..31032cab0c6 100644
--- a/src/osd/modules/render/bgfx/texture.cpp
+++ b/src/osd/modules/render/bgfx/texture.cpp
@@ -10,7 +10,7 @@
#include "texture.h"
-bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, void* data, uint32_t flags)
+bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, uint32_t flags, void* data)
: m_name(name)
, m_format(format)
, m_width(width)
@@ -32,6 +32,17 @@ bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, u
}
}
+bgfx_texture::bgfx_texture(std::string name, bgfx::TextureFormat::Enum format, uint32_t width, uint32_t height, const bgfx::Memory* data, uint32_t flags)
+ : m_name(name)
+ , m_format(format)
+ , m_width(width)
+ , m_height(height)
+{
+ bgfx::TextureInfo info;
+ bgfx::calcTextureSize(info, width, height, 1, false, 1, format);
+ m_handle = bgfx::createTexture2D(width, height, 1, format, flags, data);
+}
+
bgfx_texture::~bgfx_texture()
{
bgfx::destroyTexture(m_handle);