2010-12-04 16:14:34 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* Interfaces.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX interfaces definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _XFX_INTERFACES_
|
|
|
|
|
#define _XFX_INTERFACES_
|
|
|
|
|
|
|
|
|
|
#include <System/Types.h>
|
2012-09-28 20:36:02 +00:00
|
|
|
|
#include <System/Event.h>
|
2011-01-16 00:47:37 +00:00
|
|
|
|
|
|
|
|
|
using namespace System;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
|
{
|
|
|
|
|
class GameTime;
|
|
|
|
|
|
2011-11-07 01:29:50 +00:00
|
|
|
|
// Defines the interface for a drawable game component.
|
2010-12-04 16:14:34 +00:00
|
|
|
|
interface IDrawable
|
|
|
|
|
{
|
|
|
|
|
public:
|
2012-09-28 20:36:02 +00:00
|
|
|
|
virtual int getDrawOrder() const =0;
|
|
|
|
|
virtual bool getVisible() const =0;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
|
|
|
|
virtual void Draw(GameTime gameTime)=0;
|
2011-01-16 00:47:37 +00:00
|
|
|
|
virtual ~IDrawable() {}
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
|
|
|
|
EventHandler DrawOrderChanged;
|
|
|
|
|
EventHandler VisibleChanged;
|
|
|
|
|
};
|
|
|
|
|
|
2011-11-07 01:29:50 +00:00
|
|
|
|
// Defines an interface for game components.
|
2010-12-04 16:14:34 +00:00
|
|
|
|
interface IGameComponent
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
virtual void Initialize()=0;
|
2011-01-16 00:47:37 +00:00
|
|
|
|
virtual ~IGameComponent() {}
|
2010-12-04 16:14:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
2011-11-07 01:29:50 +00:00
|
|
|
|
// Defines the interface for an object that manages a Graphics.GraphicsDevice.
|
2012-03-29 22:02:43 +00:00
|
|
|
|
interface IGraphicsDeviceManager : virtual Object
|
2010-12-04 16:14:34 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2010-12-27 01:01:25 +00:00
|
|
|
|
virtual bool BeginDraw()=0;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
virtual void CreateDevice()=0;
|
|
|
|
|
virtual void EndDraw()=0;
|
|
|
|
|
|
2011-01-16 00:47:37 +00:00
|
|
|
|
virtual ~IGraphicsDeviceManager() {}
|
2010-12-04 16:14:34 +00:00
|
|
|
|
};
|
|
|
|
|
|
2011-11-07 01:29:50 +00:00
|
|
|
|
// Defines an interface for a game component that should be updated in Game.Update.
|
2010-12-04 16:14:34 +00:00
|
|
|
|
interface IUpdateable
|
|
|
|
|
{
|
|
|
|
|
public:
|
2012-09-28 20:36:02 +00:00
|
|
|
|
virtual bool getEnabled() const =0;
|
|
|
|
|
virtual void setEnabled(int value)=0;
|
|
|
|
|
virtual int getUpdateOrder() const =0;
|
|
|
|
|
virtual void setUpdateOrder(int value)=0;
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
2011-01-16 00:47:37 +00:00
|
|
|
|
virtual ~IUpdateable() {}
|
2010-12-04 16:14:34 +00:00
|
|
|
|
virtual void Update(GameTime gameTime)=0;
|
|
|
|
|
|
|
|
|
|
EventHandler EnabledChanged;
|
|
|
|
|
EventHandler UpdateOrderChanged;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_XFX_INTERFACES_
|