From 270d5ddc31c26b62379e3caa9044dd75ccc71847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= Date: Sun, 4 Mar 2018 10:20:27 +0100 Subject: New upstream version 0.7.0+dfsg --- silx/gui/_glutils/gl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'silx/gui/_glutils/gl.py') diff --git a/silx/gui/_glutils/gl.py b/silx/gui/_glutils/gl.py index 4b9a7bb..608d9ce 100644 --- a/silx/gui/_glutils/gl.py +++ b/silx/gui/_glutils/gl.py @@ -101,7 +101,10 @@ def enabled(capacity, enable=True): :param bool enable: True (default) to enable during context, False to disable """ - if enable: + if bool(enable) == glGetBoolean(capacity): + # Already in the right state: noop + yield + elif enable: glEnable(capacity) yield glDisable(capacity) -- cgit v1.2.3