Skip to content

Commit

Permalink
rename Renderer to Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
szabolcsdombi committed Oct 30, 2021
1 parent 644c88c commit 717f88d
Show file tree
Hide file tree
Showing 28 changed files with 95 additions and 95 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ctx = zengl.instance(zengl.context(headless=True))
size = (1280, 720)
image = ctx.image(size, 'rgba8unorm', samples=1)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ZenGL is a minimalist Python module providing exactly **one** way to render scen
| Represents an OpenGL texture or renderbuffer.
.. py:class:: Renderer
.. py:class:: Pipeline
| Represents an entire rendering pipeline including the global state, shader program, framebuffer, vertex state,
uniform buffer bindings, samplers and sampler bindings.
Expand Down Expand Up @@ -101,10 +101,10 @@ Image

.. py:method:: Instance.image(size, format, data, samples, texture) -> Image
Renderer
Pipeline
--------

.. py:method:: Instance.renderer(vertex_shader, fragment_shader, layout, resources, depth, stencil, blending, polygon_offset, color_mask, framebuffer, vertex_buffers, index_buffer, short_index, primitive_restart, front_face, cull_face, topology, vertex_count, instance_count, first_vertex, line_width, viewport) -> Renderer
.. py:method:: Instance.pipeline(vertex_shader, fragment_shader, layout, resources, depth, stencil, blending, polygon_offset, color_mask, framebuffer, vertex_buffers, index_buffer, short_index, primitive_restart, front_face, cull_face, topology, vertex_count, instance_count, first_vertex, line_width, viewport) -> Pipeline
Cleanup
-------
Expand All @@ -116,11 +116,11 @@ Clean only if necessary. It is ok not to cleanup before the program ends.
This method calls glDeleteShader for all the previously created vertex and fragment shader modules.
The resources released by this method are likely to be insignificant in size.

.. py:method:: Instance.release(obj: Buffer | Image | Renderer)
.. py:method:: Instance.release(obj: Buffer | Image | Pipeline)
This method releases the OpenGL resources associated with the parameter.
OpenGL resources are not released automatically on grabage collection.
Release Renderers before the Images and Buffers they use.
Release Pipelines before the Images and Buffers they use.

Utils
-----
Expand Down
2 changes: 1 addition & 1 deletion examples/blending.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
0.0, 0.0, 1.0, 0.5,
], 'f4'))

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
6 changes: 3 additions & 3 deletions examples/blur.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def kernel(s):

uniform_buffer = ctx.buffer(size=80)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -84,7 +84,7 @@ def kernel(s):
vertex_count=vertex_buffer.size // zengl.calcsize('3f 3f'),
)

blur_x = ctx.renderer(
blur_x = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -133,7 +133,7 @@ def kernel(s):
vertex_count=3,
)

blur_y = ctx.renderer(
blur_y = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/conways_game_of_life.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

ctx.files['size'] = 'ivec2 SIZE = ivec2(512);'

scene = ctx.renderer(
scene = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/conways_game_of_life_labyrinth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

ctx.files['size'] = 'ivec2 SIZE = ivec2(512);'

scene = ctx.renderer(
scene = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

uniform_buffer = ctx.buffer(size=80)

crate = ctx.renderer(
crate = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_triangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
image = ctx.image(window.size, 'rgba8unorm', samples=4)
image.clear_value = (1.0, 1.0, 1.0, 1.0)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_triangle_headless.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
size = (1280, 720)
image = ctx.image(size, 'rgba8unorm', samples=1)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/index_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
2, 1, 3,
], 'i4'))

square = ctx.renderer(
square = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/instanced_crates.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

uniform_buffer = ctx.buffer(size=80)

crate = ctx.renderer(
crate = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/instanced_rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

instance_buffer = ctx.buffer(xy.T.astype('f4').tobytes())

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/julia_fractal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

image = ctx.image(window.size, 'rgba8unorm', samples=4)

scene = ctx.renderer(
scene = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

uniform_buffer = ctx.buffer(size=80)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/multiple_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
image1.clear_value = (1.0, 1.0, 1.0, 1.0)
image2.clear_value = (1.0, 1.0, 1.0, 1.0)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_buffer(self):
for _ in range(ps.N)
]).astype('f4').tobytes())

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
4 changes: 2 additions & 2 deletions examples/polygon_offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

uniform_buffer = ctx.buffer(size=80)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -80,7 +80,7 @@
vertex_count=vertex_count,
)

monkey_wire = ctx.renderer(
monkey_wire = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
8 changes: 4 additions & 4 deletions examples/reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

uniform_buffer = ctx.buffer(size=80)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -69,7 +69,7 @@
vertex_count=vertex_buffer.size // zengl.calcsize('3f 3f'),
)

monkey_reflection = ctx.renderer(
monkey_reflection = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -121,7 +121,7 @@
vertex_count=vertex_buffer.size // zengl.calcsize('3f 3f'),
)

monkey_shadow = ctx.renderer(
monkey_shadow = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -184,7 +184,7 @@
vertex_count=vertex_buffer.size // zengl.calcsize('3f 3f'),
)

plane = ctx.renderer(
plane = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
4 changes: 2 additions & 2 deletions examples/render_to_texture.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

uniform_buffer = ctx.buffer(size=80)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -60,7 +60,7 @@
vertex_count=3,
)

crate = ctx.renderer(
crate = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/shader_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
0.6, -0.8, 0.0, 0.0, 1.0,
], 'f4'))

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
4 changes: 2 additions & 2 deletions examples/shadow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

uniform_buffer = ctx.buffer(size=160)

shadow_program = ctx.renderer(
shadow_program = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -71,7 +71,7 @@
vertex_count=vertex_buffer.size // zengl.calcsize('3f 12x'),
)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
4 changes: 2 additions & 2 deletions examples/stencil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

uniform_buffer = ctx.buffer(size=80)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down Expand Up @@ -63,7 +63,7 @@
vertex_count=3,
)

monkey = ctx.renderer(
monkey = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/uniform_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

uniform_buffer = ctx.buffer(size=16)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/vertex_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
0.6, -0.8, 0.0, 0.0, 1.0,
], 'f4'))

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/viewports.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
image = ctx.image(window.size, 'rgba8unorm', samples=4)
image.clear_value = (1.0, 1.0, 1.0, 1.0)

triangle = ctx.renderer(
triangle = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
2 changes: 1 addition & 1 deletion examples/wireframe_terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def create_terrain(size):

uniform_buffer = ctx.buffer(size=64)

terrain = ctx.renderer(
terrain = ctx.pipeline(
vertex_shader='''
#version 330
Expand Down
Loading

0 comments on commit 717f88d

Please sign in to comment.