util-source-texture: Add method to retrieve obs_source_t* obejct

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-03-05 16:19:42 +01:00
parent 75aeb561bd
commit 224544efff
2 changed files with 6 additions and 0 deletions

View file

@ -29,6 +29,10 @@ util::SourceTexture::SourceTexture() {
m_rt = std::make_shared<GS::RenderTarget>(GS_RGBA, GS_ZS_NONE);
}
obs_source_t* util::SourceTexture::GetObject() {
return m_source;
}
util::SourceTexture::SourceTexture(const char* name) : SourceTexture() {
m_source = obs_get_source_by_name(name);
if (!m_source) {

View file

@ -34,6 +34,8 @@ namespace util {
SourceTexture(std::string name);
SourceTexture(obs_source_t* src);
obs_source_t* GetObject();
std::shared_ptr<GS::Texture> Render(size_t width, size_t height);
};
}