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; Content = Services.GetSafeServiceAs <ContentManager>(); 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"); if (Context != null) { Unload(); } Context = context; 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"); } if (Context != null) { Unload(); } Context = context; InitializeCore(); Initialized = true; // Notify that a particular renderer has been initialized. context.OnRendererInitialized(this); }