mirror of https://github.com/Xaymar/obs-StreamFX
gs-effect: Allow directly assigning OBS GS objects
This commit is contained in:
parent
0565065c2b
commit
a307283349
|
@ -251,8 +251,20 @@ void GS::EffectParameter::SetTexture(std::shared_ptr<GS::Texture> v) {
|
|||
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) {
|
||||
if (GetType() != Type::Texture)
|
||||
throw std::bad_cast();
|
||||
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 SetMatrix(matrix4& 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(gs_sampler_state* v);
|
||||
|
||||
private:
|
||||
gs_eparam_t* m_param;
|
||||
|
|
Loading…
Reference in New Issue