From c560b8085a9e90b9e8e74f5f4fe97740e0510823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 15 Jan 2020 19:31:31 +0100 Subject: [PATCH] python: added gl.AbstractTexture.unbind(). --- src/python/magnum/gl.cpp | 1 + src/python/magnum/test/test_gl_gl.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/python/magnum/gl.cpp b/src/python/magnum/gl.cpp index 72108b3..5f45fb8 100644 --- a/src/python/magnum/gl.cpp +++ b/src/python/magnum/gl.cpp @@ -1059,6 +1059,7 @@ void gl(py::module& m) { /** @todo compressed formats */ PyNonDestructibleClass{m, "AbstractTexture", "Base for textures"} + .def_static("unbind", static_cast(&GL::AbstractTexture::unbind), "Unbind any texture from given texture unit") /** @todo limits */ .def_property_readonly("id", &GL::AbstractTexture::id, "OpenGL texture ID") /** @todo list-taking bind */ diff --git a/src/python/magnum/test/test_gl_gl.py b/src/python/magnum/test/test_gl_gl.py index 90da61e..0ae2373 100644 --- a/src/python/magnum/test/test_gl_gl.py +++ b/src/python/magnum/test/test_gl_gl.py @@ -311,6 +311,10 @@ class Shader(GLTestCase): with self.assertRaisesRegex(RuntimeError, "compilation failed"): a.compile() +class AbstractTexture(GLTestCase): + def test_unbind(self): + gl.AbstractTexture.unbind(3) + class Texture(GLTestCase): def test_minification_filter(self): a = gl.Texture2D()