From 3c8c9760865d14c8dffa3a4cd091e4027b1501e3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 20 Nov 2018 07:32:49 +1100 Subject: Cleanup: gpu docs --- doc/python_api/examples/gpu.7.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'doc/python_api/examples/gpu.7.py') diff --git a/doc/python_api/examples/gpu.7.py b/doc/python_api/examples/gpu.7.py index 486ed5fd411..69af65e163e 100644 --- a/doc/python_api/examples/gpu.7.py +++ b/doc/python_api/examples/gpu.7.py @@ -13,13 +13,18 @@ IMAGE_NAME = "Untitled" image = bpy.data.images[IMAGE_NAME] shader = gpu.shader.from_builtin('2D_IMAGE') -batch = batch_for_shader(shader, 'TRI_FAN', - {"pos" : ((100, 100), (200, 100), (200, 200), (100, 200)), - "texCoord" : ((0, 0), (1, 0), (1, 1), (0, 1))}) +batch = batch_for_shader( + shader, 'TRI_FAN', + { + "pos": ((100, 100), (200, 100), (200, 200), (100, 200)), + "texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)), + }, +) if image.gl_load(): raise Exception() + def draw(): bgl.glActiveTexture(bgl.GL_TEXTURE0) bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode) @@ -28,4 +33,5 @@ def draw(): shader.uniform_int("image", 0) batch.draw(shader) -bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL') \ No newline at end of file + +bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL') -- cgit v1.2.3