diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-11-19 16:32:30 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-11-19 16:32:51 +0300 |
commit | 422992a135bda9b4da2311a7ebca1f896391c027 (patch) | |
tree | c8b93cbf51d110509f00c1452d3ab5ead47768bb /doc/python_api/examples/gpu.8.py | |
parent | 51711fdcaa48e37e1d6cf3dfb27d8d234786bd1b (diff) |
Py API Docs: use new bind context manager in gpu examples
Diffstat (limited to 'doc/python_api/examples/gpu.8.py')
-rw-r--r-- | doc/python_api/examples/gpu.8.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/doc/python_api/examples/gpu.8.py b/doc/python_api/examples/gpu.8.py index 7e41164fc7e..28964d2e6b2 100644 --- a/doc/python_api/examples/gpu.8.py +++ b/doc/python_api/examples/gpu.8.py @@ -19,8 +19,7 @@ from gpu_extras.presets import draw_circle_2d offscreen = gpu.types.GPUOffScreen(512, 512) -offscreen.bind() -try: +with offscreen.bind(): bgl.glClear(bgl.GL_COLOR_BUFFER_BIT) with gpu.matrix.push_pop(): # reset matrices -> use normalized device coordinates [-1, 1] @@ -31,8 +30,6 @@ try: for i in range(-amount, amount + 1): x_pos = i / amount draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200) -finally: - offscreen.unbind() # Drawing the generated texture in 3D space |