diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 18:34:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 18:34:51 +0300 |
commit | fe5efccd8fb6ce2a7e5e858e3f8becf5f98bb087 (patch) | |
tree | dfe98f0fa8ad533faf6dfbaaa723c2a88cd87df9 /source | |
parent | bf3f4da9472516be12dcc69740fa69b6d72f1274 (diff) |
GPUOffscreen: Push the GL state before and after binding
This avoids wrong viewport and scissor bounds with BGL commands.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/gpu/gpu_py_offscreen.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c index 15c39de990b..31440dadd03 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.c +++ b/source/blender/python/gpu/gpu_py_offscreen.c @@ -157,6 +157,7 @@ static PyObject *bpygpu_offscreen_bind(BPyGPUOffScreen *self, PyObject *args, Py } GPU_offscreen_bind(self->ofs, save); + GPU_apply_state(); self->is_saved = save; Py_INCREF(self); @@ -185,6 +186,7 @@ static PyObject *bpygpu_offscreen_unbind(BPyGPUOffScreen *self, PyObject *args, } GPU_offscreen_unbind(self->ofs, restore); + GPU_apply_state(); Py_RETURN_NONE; } |