mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-23 20:05:11 +00:00
obs/gs/effect-parameter: Add support for sRGB texture inputs
This commit is contained in:
parent
22786005d6
commit
6f7c03fb28
2 changed files with 10 additions and 8 deletions
|
@ -647,18 +647,20 @@ void streamfx::obs::gs::effect_parameter::get_default_matrix(matrix4& v)
|
|||
}
|
||||
}
|
||||
|
||||
void streamfx::obs::gs::effect_parameter::set_texture(std::shared_ptr<streamfx::obs::gs::texture> v)
|
||||
void streamfx::obs::gs::effect_parameter::set_texture(std::shared_ptr<streamfx::obs::gs::texture> v, bool srgb)
|
||||
{
|
||||
if (get_type() != type::Texture)
|
||||
throw std::bad_cast();
|
||||
gs_effect_set_texture(get(), v->get_object());
|
||||
set_texture(v->get_object(), srgb);
|
||||
}
|
||||
|
||||
void streamfx::obs::gs::effect_parameter::set_texture(gs_texture_t* v)
|
||||
void streamfx::obs::gs::effect_parameter::set_texture(gs_texture_t* v, bool srgb)
|
||||
{
|
||||
if (get_type() != type::Texture)
|
||||
throw std::bad_cast();
|
||||
gs_effect_set_texture(get(), v);
|
||||
if (!srgb) {
|
||||
gs_effect_set_texture(get(), v);
|
||||
} else {
|
||||
gs_effect_set_texture_srgb(get(), v);
|
||||
}
|
||||
}
|
||||
|
||||
void streamfx::obs::gs::effect_parameter::set_sampler(std::shared_ptr<streamfx::obs::gs::sampler> v)
|
||||
|
|
|
@ -189,8 +189,8 @@ namespace streamfx::obs::gs {
|
|||
void get_matrix(matrix4& v);
|
||||
void get_default_matrix(matrix4& v);
|
||||
|
||||
void set_texture(std::shared_ptr<streamfx::obs::gs::texture> v);
|
||||
void set_texture(gs_texture_t* v);
|
||||
void set_texture(std::shared_ptr<streamfx::obs::gs::texture> v, bool srgb = false);
|
||||
void set_texture(gs_texture_t* v, bool srgb = false);
|
||||
|
||||
void set_sampler(std::shared_ptr<streamfx::obs::gs::sampler> v);
|
||||
void set_sampler(gs_sampler_state* v);
|
||||
|
|
Loading…
Reference in a new issue