26 using SiliconStudio.Paradox.Graphics;
27 using SiliconStudio.Core;
28 using SiliconStudio.Core.Serialization.Assets;
30 namespace SiliconStudio.
Paradox.Games
41 private int drawOrder;
44 private int updateOrder;
58 if (registry == null)
throw new ArgumentNullException(
"registry");
59 this.registry = registry;
105 return graphicsDeviceService != null ? graphicsDeviceService.GraphicsDevice : null;
109 #region IDrawable Members
130 get {
return visible; }
133 if (visible != value)
143 get {
return drawOrder; }
146 if (drawOrder != value)
149 OnDrawOrderChanged(
this,
EventArgs.Empty);
156 #region IGameSystemBase Members
166 #region IUpdateable Members
178 get {
return enabled; }
181 if (enabled != value)
189 public int UpdateOrder
191 get {
return updateOrder; }
194 if (updateOrder != value)
197 OnUpdateOrderChanged(
this,
EventArgs.Empty);
206 EventHandler<EventArgs> handler = DrawOrderChanged;
207 if (handler != null) handler(source, e);
210 private void OnVisibleChanged(
EventArgs e)
212 EventHandler<EventArgs> handler = VisibleChanged;
213 if (handler != null) handler(
this, e);
216 private void OnEnabledChanged(
EventArgs e)
218 EventHandler<EventArgs> handler = EnabledChanged;
219 if (handler != null) handler(
this, e);
224 EventHandler<EventArgs> handler = UpdateOrderChanged;
225 if (handler != null) handler(source, e);
228 #region Implementation of IContentable
230 void IContentable.LoadContent()
235 void IContentable.UnloadContent()
GameSystemBase(IServiceRegistry registry)
Initializes a new instance of the GameSystemBase class.
Service providing method to access GraphicsDevice life-cycle.
An interface that is called by GameBase.Update.
virtual void Draw(GameTime gameTime)
Draws this instance.
An interface to load and unload asset.
Interface of the asset manager.
EventHandler< EventArgs > DrawOrderChanged
virtual bool BeginDraw()
Starts the drawing of a frame. This method is followed by calls to Draw and EndDraw.
A service registry is a IServiceProvider that provides methods to register and unregister services...
Base class for a framework component.
Defines a generic game system.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Base class for a GameSystemBase component.
virtual void Initialize()
This method is called when the component is added to the game.
virtual void Update(GameTime gameTime)
This method is called when this game component is updated.
Current timing used for variable-step (real time) or fixed-step (game time) games.
virtual void OnUpdateOrderChanged(object source, EventArgs e)
virtual void UnloadContent()
Called when graphics resources need to be unloaded. Override this method to unload any game-specific ...
virtual void EndDraw()
Ends the drawing of a frame. This method is preceeded by calls to Draw and BeginDraw.
An interface for a drawable game component that is called by the GameBase class.
virtual void LoadContent()
Loads the assets.
EventHandler< EventArgs > VisibleChanged
virtual void OnDrawOrderChanged(object source, EventArgs e)
EventHandler< EventArgs > EnabledChanged
EventHandler< EventArgs > UpdateOrderChanged