File: conditional_render.rst

package info (click to toggle)
python-moderngl 5.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,700 kB
  • sloc: python: 15,758; cpp: 14,665; makefile: 14
file content (24 lines) | stat: -rw-r--r-- 530 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ConditionalRender
=================

.. py:class:: ConditionalRender

    Available in :py:attr:`Query.crender`

    This class represents a ConditionalRender object.

    ConditionalRender objects can only be accessed from :py:class:`Query` objects.

Examples
--------

.. code-block:: python

    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.