#include "programdata.h"
#include "renderable.h"
#include "renderer.h"
+#include "sampler.h"
#include "texture.h"
#include "texturing.h"
#include "texunit.h"
changed |= MATRIX;
}
-void Renderer::set_texture(const Texture *t)
+void Renderer::set_texture(const Texture *t, const Sampler *s)
{
state->texture = t;
+ state->sampler = s;
state->texturing = 0;
}
{
state->texturing = t;
state->texture = 0;
+ state->sampler = 0;
}
unsigned Renderer::allocate_effect_texunit()
{
Texturing::unbind();
if(state->texture)
+ {
+ if(state->sampler)
+ state->sampler->bind_to(0);
+ else
+ Sampler::unbind_from(0);
state->texture->bind_to(0);
+ }
else
Texture::unbind_from(0);
}