public void Initialize(RenderContext context) { if (context == null) { throw new ArgumentNullException("context"); } // Unload the previous context if any if (Context != null) { Unload(); } Context = context; subRenderersToUnload.Clear(); // Initialize most common services related to rendering Services = Context.Services; Assets = Services.GetSafeServiceAs <AssetManager>(); EffectSystem = Services.GetSafeServiceAs <EffectSystem>(); GraphicsDevice = Services.GetSafeServiceAs <IGraphicsDeviceService>().GraphicsDevice; InitializeCore(); Initialized = true; // Notify that a particular renderer has been initialized. context.OnRendererInitialized(this); }
public void Initialize(RenderContext context) { if (context == null) { throw new ArgumentNullException("context"); } // Unload the previous context if any if (Context != null) { Unload(); } Context = context; subRenderersToUnload.Clear(); InitializeCore(); Initialized = true; // Notify that a particular renderer has been initialized. context.OnRendererInitialized(this); }