Source code for picogl.renderer.abstract

"""
Defines the AbstractRenderer class, serving as a base class for rendering
objects. This class enforces initialization routines and requires
implementation of rendering and resource management methods in its derived
classes.
"""

from abc import ABC, abstractmethod

from picogl.renderer.initializable import Initializable


[docs] class AbstractRenderer(Initializable, ABC):
[docs] def __init__(self): super().__init__()
@abstractmethod
[docs] def _do_initialize(self) -> None: """Subclasses must implement actual setup."""
[docs] def set_visibility(self, visible: bool) -> None: """Set the visibility of the object.""" pass
@abstractmethod
[docs] def render(self): pass
"""@abstractmethod def delete(self):""" """Release resources (VAO or equivalent)."""