mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-14 07:45:06 +00:00
gfx/shader: Add a way to retrieve the underlying obs_source_t*
This commit is contained in:
parent
bba606e439
commit
69a72d4975
2 changed files with 7 additions and 1 deletions
|
@ -53,7 +53,7 @@ streamfx::gfx::shader::shader::shader(obs_source_t* self, shader_mode mode)
|
||||||
|
|
||||||
_rt_up_to_date(false), _rt(std::make_shared<streamfx::obs::gs::rendertarget>(GS_RGBA, GS_ZS_NONE))
|
_rt_up_to_date(false), _rt(std::make_shared<streamfx::obs::gs::rendertarget>(GS_RGBA, GS_ZS_NONE))
|
||||||
{
|
{
|
||||||
// Intialize random values.
|
// Initialize random values.
|
||||||
_random.seed(static_cast<unsigned long long>(_random_seed));
|
_random.seed(static_cast<unsigned long long>(_random_seed));
|
||||||
for (size_t idx = 0; idx < 16; idx++) {
|
for (size_t idx = 0; idx < 16; idx++) {
|
||||||
_random_values[idx] =
|
_random_values[idx] =
|
||||||
|
@ -615,3 +615,7 @@ void streamfx::gfx::shader::shader::set_active(bool active)
|
||||||
static_cast<float_t>(static_cast<double_t>(_random()) / static_cast<double_t>(_random.max()));
|
static_cast<float_t>(static_cast<double_t>(_random()) / static_cast<double_t>(_random.max()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
obs_source_t* streamfx::gfx::shader::shader::get() {
|
||||||
|
return _self;
|
||||||
|
}
|
||||||
|
|
|
@ -115,6 +115,8 @@ namespace streamfx::gfx {
|
||||||
|
|
||||||
void render(gs_effect* effect);
|
void render(gs_effect* effect);
|
||||||
|
|
||||||
|
obs_source_t* get();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void set_size(uint32_t w, uint32_t h);
|
void set_size(uint32_t w, uint32_t h);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue