mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
gs-rendertarget: Add and implement GetTexture(...) methods
This commit is contained in:
parent
7d065c131d
commit
cc68e2864f
2 changed files with 17 additions and 0 deletions
|
@ -50,6 +50,18 @@ gs_texture_t* GS::RenderTarget::GetTextureObject() {
|
|||
return tex;
|
||||
}
|
||||
|
||||
void GS::RenderTarget::GetTexture(GS::Texture& tex) {
|
||||
tex = GS::Texture(GetTextureObject(), false);
|
||||
}
|
||||
|
||||
void GS::RenderTarget::GetTexture(std::shared_ptr<GS::Texture>& tex) {
|
||||
tex = std::make_shared<GS::Texture>(GetTextureObject(), false);
|
||||
}
|
||||
|
||||
void GS::RenderTarget::GetTexture(std::unique_ptr<GS::Texture>& tex) {
|
||||
tex = std::make_unique<GS::Texture>(GetTextureObject(), false);
|
||||
}
|
||||
|
||||
GS::RenderTargetOp::RenderTargetOp(GS::RenderTarget* rt, uint32_t width, uint32_t height) : m_renderTarget(rt) {
|
||||
if (m_renderTarget == nullptr)
|
||||
throw std::invalid_argument("rt");
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#pragma once
|
||||
#include <inttypes.h>
|
||||
#include <memory>
|
||||
#include "gs-texture.h"
|
||||
extern "C" {
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable: 4201 )
|
||||
|
@ -35,6 +37,9 @@ namespace GS {
|
|||
virtual ~RenderTarget();
|
||||
|
||||
gs_texture_t* GetTextureObject();
|
||||
void GetTexture(GS::Texture& tex);
|
||||
void GetTexture(std::shared_ptr<GS::Texture>& tex);
|
||||
void GetTexture(std::unique_ptr<GS::Texture>& tex);
|
||||
GS::RenderTargetOp Render(uint32_t width, uint32_t height);
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue