GPUOffscreen: Push the GL state before and after binding

This avoids wrong viewport and scissor bounds with BGL commands.
This commit is contained in:
Clément Foucault 2020-09-12 17:34:51 +02:00
parent bf3f4da947
commit fe5efccd8f
Notes: blender-bot 2024-02-26 14:24:25 +01:00
Referenced by issue blender/blender-addons#80730, BGL deprecation
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}