diff --git a/source/gs-rendertarget.cpp b/source/gs-rendertarget.cpp index 65428740..8e5ce3f9 100644 --- a/source/gs-rendertarget.cpp +++ b/source/gs-rendertarget.cpp @@ -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& tex) { + tex = std::make_shared(GetTextureObject(), false); +} + +void GS::RenderTarget::GetTexture(std::unique_ptr& tex) { + tex = std::make_unique(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"); diff --git a/source/gs-rendertarget.h b/source/gs-rendertarget.h index ce1c62c3..f866d835 100644 --- a/source/gs-rendertarget.h +++ b/source/gs-rendertarget.h @@ -19,6 +19,8 @@ #pragma once #include +#include +#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& tex); + void GetTexture(std::unique_ptr& tex); GS::RenderTargetOp Render(uint32_t width, uint32_t height); protected: