]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/sampler_backend.cpp
Add support for padding in vertex formats
[libs/gl.git] / source / backends / opengl / sampler_backend.cpp
index 915dda68f5db14bd67ea996217f810296dd8486f..8198e40feba4c20f5966c4e3a1d194611596587f 100644 (file)
@@ -25,6 +25,18 @@ OpenGLSampler::OpenGLSampler()
                glGenSamplers(1, &id);
 }
 
+OpenGLSampler::OpenGLSampler(OpenGLSampler &&other):
+       id(other.id)
+{
+       other.id = 0;
+}
+
+OpenGLSampler::~OpenGLSampler()
+{
+       if(id)
+               glDeleteSamplers(1, &id);
+}
+
 bool OpenGLSampler::check_anisotropic(bool require)
 {
        if(require)
@@ -60,7 +72,7 @@ void OpenGLSampler::update(unsigned mask) const
 void OpenGLSampler::set_debug_name(const string &name)
 {
 #ifdef DEBUG
-       if(id && KHR_debug)
+       if(KHR_debug)
                glObjectLabel(GL_SAMPLER, id, name.size(), name.c_str());
 #else
        (void)name;