Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 495 Bytes

conditional_render.rst

File metadata and controls

26 lines (17 loc) · 495 Bytes

ConditionalRender

.. py:module:: moderngl
.. py:currentmodule:: moderngl

.. autoclass:: moderngl.ConditionalRender

Examples

Simple conditional rendering example

query = ctx.query(any_samples=True)

with query:
    vao1.render()

with query.crender:
    print('This will always get printed')
    vao2.render()  # But this will be rendered only if vao1 has passing samples.
.. toctree::
    :maxdepth: 2