gs-effect: Implement method to override the next sampler

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2018-01-19 05:10:10 +01:00
parent 36cd5bbf21
commit 102e4e5eeb
2 changed files with 8 additions and 1 deletions

View file

@ -250,3 +250,9 @@ void GS::EffectParameter::SetTexture(std::shared_ptr<GS::Texture> v) {
throw std::bad_cast();
gs_effect_set_texture(m_param, v->GetObject());
}
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());
}

View file

@ -19,6 +19,7 @@
#pragma once
#include "gs-texture.h"
#include "gs-sampler.h"
#include <inttypes.h>
#include <memory>
#include <string>
@ -76,7 +77,7 @@ namespace GS {
void SetIntegerArray(int32_t v[], size_t sz);
void SetMatrix(matrix4& v);
void SetTexture(std::shared_ptr<GS::Texture> v);
void SetTextureSampler();
void SetSampler(std::shared_ptr<GS::Sampler> v);
private:
gs_eparam_t* m_param;