Skip to content

Scene

Scene

A scene that defines a collection of meshes and renders them.

Parameters:

Name Type Description Default
opengl_context Context

The OpenGL context.

required
program Program

The shader program used to render the scene.

required
Source code in pynecraft/scene.py
class Scene:
    """A scene that defines a collection of meshes and renders them.

    Args:
        opengl_context (moderngl.Context): The OpenGL context.
        program (moderngl.Program): The shader program used to render the scene.
    """

    def __init__(
        self, opengl_context: moderngl.Context, program: moderngl.Program
    ) -> None:
        self.mesh = QuadMesh(opengl_context=opengl_context, program=program)

    def update(self) -> None:
        pass

    def render(self):
        """Render the scene."""
        self.mesh.render()

render()

Render the scene.

Source code in pynecraft/scene.py
def render(self):
    """Render the scene."""
    self.mesh.render()