mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
gs-rendertarget: Allow retrieving color and zstencil format
This commit is contained in:
parent
faeb5af45b
commit
fb77cc90a6
2 changed files with 19 additions and 0 deletions
|
@ -23,6 +23,7 @@
|
|||
extern "C" {
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4201)
|
||||
#include <graphics/graphics.h>
|
||||
#include <obs.h>
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
@ -35,6 +36,7 @@ gs::rendertarget::~rendertarget()
|
|||
}
|
||||
|
||||
gs::rendertarget::rendertarget(gs_color_format colorFormat, gs_zstencil_format zsFormat)
|
||||
: color_format(colorFormat), zstencil_format(zsFormat)
|
||||
{
|
||||
is_being_rendered = false;
|
||||
obs_enter_graphics();
|
||||
|
@ -70,6 +72,16 @@ void gs::rendertarget::get_texture(std::unique_ptr<gs::texture>& tex)
|
|||
tex = std::make_unique<gs::texture>(get_object(), false);
|
||||
}
|
||||
|
||||
gs_color_format gs::rendertarget::get_color_format()
|
||||
{
|
||||
return color_format;
|
||||
}
|
||||
|
||||
gs_zstencil_format gs::rendertarget::get_zstencil_format()
|
||||
{
|
||||
return zstencil_format;
|
||||
}
|
||||
|
||||
gs::rendertarget_op::rendertarget_op(gs::rendertarget* rt, uint32_t width, uint32_t height) : parent(rt)
|
||||
{
|
||||
if (parent == nullptr)
|
||||
|
|
|
@ -37,6 +37,9 @@ namespace gs {
|
|||
gs_texrender_t* render_target;
|
||||
bool is_being_rendered;
|
||||
|
||||
gs_color_format color_format;
|
||||
gs_zstencil_format zstencil_format;
|
||||
|
||||
public:
|
||||
~rendertarget();
|
||||
|
||||
|
@ -50,6 +53,10 @@ namespace gs {
|
|||
|
||||
void get_texture(std::unique_ptr<gs::texture>& tex);
|
||||
|
||||
gs_color_format get_color_format();
|
||||
|
||||
gs_zstencil_format get_zstencil_format();
|
||||
|
||||
gs::rendertarget_op render(uint32_t width, uint32_t height);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue