"""
渲染管线工具模块
提供全局渲染管线实例的访问功能
"""

# 全局渲染管线实例
_global_render_pipeline = None

def get_render_pipeline():
    """获取全局 RenderPipeline 单例"""
    global _global_render_pipeline
    if _global_render_pipeline is None:
        raise RuntimeError(
            "RenderPipeline has not been initialized yet. Please create a CoreWorld instance first.")
    return _global_render_pipeline

def set_render_pipeline(pipeline):
    """设置全局渲染管线实例"""
    global _global_render_pipeline
    _global_render_pipeline = pipeline