obs-StreamFX/source/obs/gs/gs-rendertarget.hpp

66 lines
1.8 KiB
C++
Raw Normal View History

// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// Copyright (C) 2022 lainon <GermanAizek@yandex.ru>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include "common.hpp"
#include "gs-texture.hpp"
2021-06-08 02:38:24 +00:00
namespace streamfx::obs::gs {
class rendertarget_op;
2019-04-02 22:19:01 +00:00
class rendertarget {
friend class rendertarget_op;
protected:
2019-08-04 14:20:26 +00:00
gs_texrender_t* _render_target;
bool _is_being_rendered;
2019-08-04 14:20:26 +00:00
gs_color_format _color_format;
gs_zstencil_format _zstencil_format;
public:
~rendertarget();
rendertarget(gs_color_format colorFormat, gs_zstencil_format zsFormat);
gs_texture_t* get_object();
2021-06-08 02:38:24 +00:00
std::shared_ptr<streamfx::obs::gs::texture> get_texture();
2021-06-08 02:38:24 +00:00
void get_texture(streamfx::obs::gs::texture& tex);
2021-06-08 02:38:24 +00:00
void get_texture(std::shared_ptr<streamfx::obs::gs::texture>& tex);
2021-06-08 02:38:24 +00:00
void get_texture(std::unique_ptr<streamfx::obs::gs::texture>& tex);
gs_color_format get_color_format();
gs_zstencil_format get_zstencil_format();
2021-06-08 02:38:24 +00:00
streamfx::obs::gs::rendertarget_op render(uint32_t width, uint32_t height);
streamfx::obs::gs::rendertarget_op render(uint32_t width, uint32_t height, gs_color_space cs);
};
class rendertarget_op {
2021-06-08 02:38:24 +00:00
streamfx::obs::gs::rendertarget* parent;
public:
~rendertarget_op();
2021-06-08 02:38:24 +00:00
rendertarget_op(streamfx::obs::gs::rendertarget* rt, uint32_t width, uint32_t height);
rendertarget_op(streamfx::obs::gs::rendertarget* rt, uint32_t width, uint32_t height, gs_color_space cs);
// Move Constructor
rendertarget_op(streamfx::obs::gs::rendertarget_op&&) noexcept;
// Copy Constructor
2021-06-08 02:38:24 +00:00
rendertarget_op(const streamfx::obs::gs::rendertarget_op&) = delete;
2021-06-08 02:38:24 +00:00
rendertarget_op& operator=(const streamfx::obs::gs::rendertarget_op& r) = delete;
};
2021-06-08 02:38:24 +00:00
} // namespace streamfx::obs::gs