2023-02-28 01:15:26 +00:00
|
|
|
// AUTOGENERATED COPYRIGHT HEADER START
|
|
|
|
// Copyright (C) 2019-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
2018-03-05 14:17:34 +00:00
|
|
|
|
|
|
|
#pragma once
|
2020-04-02 15:02:01 +00:00
|
|
|
#include "common.hpp"
|
2019-02-11 02:54:16 +00:00
|
|
|
#include "obs/gs/gs-rendertarget.hpp"
|
|
|
|
#include "obs/gs/gs-texture.hpp"
|
2022-12-02 03:39:06 +00:00
|
|
|
#include "obs/obs-source.hpp"
|
2022-05-26 00:58:55 +00:00
|
|
|
#include "obs/obs-weak-source.hpp"
|
2018-09-28 21:31:21 +00:00
|
|
|
|
2022-08-29 10:29:44 +00:00
|
|
|
#include "warning-disable.hpp"
|
|
|
|
#include <map>
|
|
|
|
#include "warning-enable.hpp"
|
|
|
|
|
2021-06-08 02:47:04 +00:00
|
|
|
namespace streamfx::gfx {
|
2018-03-20 11:50:17 +00:00
|
|
|
class source_texture {
|
2022-05-26 00:58:55 +00:00
|
|
|
streamfx::obs::source _parent;
|
|
|
|
streamfx::obs::source _child;
|
2018-09-28 21:31:21 +00:00
|
|
|
|
2021-06-08 02:38:24 +00:00
|
|
|
std::shared_ptr<streamfx::obs::gs::rendertarget> _rt;
|
2018-03-05 14:17:34 +00:00
|
|
|
|
|
|
|
public:
|
2018-03-20 11:50:17 +00:00
|
|
|
~source_texture();
|
2022-12-02 03:39:06 +00:00
|
|
|
source_texture(streamfx::obs::source child, streamfx::obs::source parent);
|
2018-03-05 15:19:42 +00:00
|
|
|
|
2019-01-27 21:50:35 +00:00
|
|
|
public /*copy*/:
|
2022-06-13 04:13:13 +00:00
|
|
|
source_texture(source_texture const& other) = delete;
|
2019-01-27 21:50:35 +00:00
|
|
|
source_texture& operator=(source_texture const& other) = delete;
|
|
|
|
|
|
|
|
public /*move*/:
|
2022-06-13 04:13:13 +00:00
|
|
|
source_texture(source_texture&& other) = delete;
|
2019-01-27 21:50:35 +00:00
|
|
|
source_texture& operator=(source_texture&& other) = delete;
|
|
|
|
|
|
|
|
public:
|
2021-06-08 02:38:24 +00:00
|
|
|
std::shared_ptr<streamfx::obs::gs::texture> render(std::size_t width, std::size_t height);
|
2018-11-07 13:09:03 +00:00
|
|
|
|
|
|
|
public: // Unsafe Methods
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
obs_source_t* get_object();
|
|
|
|
obs_source_t* get_parent();
|
2018-03-05 14:17:34 +00:00
|
|
|
};
|
2021-06-08 02:47:04 +00:00
|
|
|
} // namespace streamfx::gfx
|