From 102e4e5eeb9d52a06d209599160da1e7b12ffbe6 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Fri, 19 Jan 2018 05:10:10 +0100 Subject: [PATCH] gs-effect: Implement method to override the next sampler --- source/gs-effect.cpp | 6 ++++++ source/gs-effect.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/gs-effect.cpp b/source/gs-effect.cpp index d3bc1ef7..f69a2e8b 100644 --- a/source/gs-effect.cpp +++ b/source/gs-effect.cpp @@ -250,3 +250,9 @@ void GS::EffectParameter::SetTexture(std::shared_ptr v) { throw std::bad_cast(); gs_effect_set_texture(m_param, v->GetObject()); } + +void GS::EffectParameter::SetSampler(std::shared_ptr v) { + if (GetType() != Type::Texture) + throw std::bad_cast(); + gs_effect_set_next_sampler(m_param, v->GetObject()); +} diff --git a/source/gs-effect.h b/source/gs-effect.h index acb1ee23..fbccb833 100644 --- a/source/gs-effect.h +++ b/source/gs-effect.h @@ -19,6 +19,7 @@ #pragma once #include "gs-texture.h" +#include "gs-sampler.h" #include #include #include @@ -76,7 +77,7 @@ namespace GS { void SetIntegerArray(int32_t v[], size_t sz); void SetMatrix(matrix4& v); void SetTexture(std::shared_ptr v); - void SetTextureSampler(); + void SetSampler(std::shared_ptr v); private: gs_eparam_t* m_param;