- Require _req(ARB_sampler_objects);
- if(ARB_direct_state_access)
- glCreateSamplers(1, &id);
- else
- glGenSamplers(1, &id);
-}
-
-void Sampler::update_parameter(int mask) const
-{
- if(mask&MIN_FILTER)
- glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, min_filter);
- if(mask&MAG_FILTER)
- glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, mag_filter);
- if(mask&MAX_ANISOTROPY)
- glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, max_anisotropy);
- if(mask&WRAP_S)
- glSamplerParameteri(id, GL_TEXTURE_WRAP_S, wrap_s);
- if(mask&WRAP_T)
- glSamplerParameteri(id, GL_TEXTURE_WRAP_T, wrap_t);
- if(mask&WRAP_R)
- glSamplerParameteri(id, GL_TEXTURE_WRAP_R, wrap_r);
- if(mask&BORDER_COLOR)
- glSamplerParameterfv(id, GL_TEXTURE_BORDER_COLOR, &border_color.r);
- if(mask&COMPARE)
- {
- glSamplerParameteri(id, GL_TEXTURE_COMPARE_MODE, (compare ? GL_COMPARE_R_TO_TEXTURE : GL_NONE));
- if(compare)
- glSamplerParameteri(id, GL_TEXTURE_COMPARE_FUNC, cmp_func);
- }