mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-10 22:05:06 +00:00
gs-effect: Allow directly assigning OBS GS objects
This commit is contained in:
parent
0565065c2b
commit
a307283349
2 changed files with 14 additions and 0 deletions
|
@ -251,8 +251,20 @@ void GS::EffectParameter::SetTexture(std::shared_ptr<GS::Texture> v) {
|
||||||
gs_effect_set_texture(m_param, v->GetObject());
|
gs_effect_set_texture(m_param, v->GetObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GS::EffectParameter::SetTexture(gs_texture_t* v) {
|
||||||
|
if (GetType() != Type::Texture)
|
||||||
|
throw std::bad_cast();
|
||||||
|
gs_effect_set_texture(m_param, v);
|
||||||
|
}
|
||||||
|
|
||||||
void GS::EffectParameter::SetSampler(std::shared_ptr<GS::Sampler> v) {
|
void GS::EffectParameter::SetSampler(std::shared_ptr<GS::Sampler> v) {
|
||||||
if (GetType() != Type::Texture)
|
if (GetType() != Type::Texture)
|
||||||
throw std::bad_cast();
|
throw std::bad_cast();
|
||||||
gs_effect_set_next_sampler(m_param, v->GetObject());
|
gs_effect_set_next_sampler(m_param, v->GetObject());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GS::EffectParameter::SetSampler(gs_sampler_state* v) {
|
||||||
|
if (GetType() != Type::Texture)
|
||||||
|
throw std::bad_cast();
|
||||||
|
gs_effect_set_next_sampler(m_param, v);
|
||||||
|
}
|
||||||
|
|
|
@ -77,7 +77,9 @@ namespace GS {
|
||||||
void SetIntegerArray(int32_t v[], size_t sz);
|
void SetIntegerArray(int32_t v[], size_t sz);
|
||||||
void SetMatrix(matrix4& v);
|
void SetMatrix(matrix4& v);
|
||||||
void SetTexture(std::shared_ptr<GS::Texture> v);
|
void SetTexture(std::shared_ptr<GS::Texture> v);
|
||||||
|
void SetTexture(gs_texture_t* v);
|
||||||
void SetSampler(std::shared_ptr<GS::Sampler> v);
|
void SetSampler(std::shared_ptr<GS::Sampler> v);
|
||||||
|
void SetSampler(gs_sampler_state* v);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gs_eparam_t* m_param;
|
gs_eparam_t* m_param;
|
||||||
|
|
Loading…
Reference in a new issue