metaforce/Runtime/CIOWin.hpp

42 lines
984 B
C++
Raw Permalink Normal View History

2015-08-18 05:54:43 +00:00
#ifndef __RETRO_CIOWIN_HPP__
#define __RETRO_CIOWIN_HPP__
2015-08-20 02:52:07 +00:00
#include <string>
2015-08-26 01:34:56 +00:00
#include "rstl.hpp"
2015-08-20 02:52:07 +00:00
2015-08-18 05:54:43 +00:00
namespace Retro
{
2015-08-22 01:58:41 +00:00
class CArchitectureMessage;
class CArchitectureQueue;
2015-08-18 05:54:43 +00:00
class CIOWin
{
2015-08-26 01:34:56 +00:00
std::string m_name;
size_t m_nameHash;
2015-08-20 02:52:07 +00:00
public:
2015-08-26 01:34:56 +00:00
enum EMessageReturn
{
MsgRetNormal = 0,
MsgRetExit = 1,
MsgRetRemoveIOWinAndExit = 2,
MsgRetRemoveIOWin = 3
};
2015-08-20 02:52:07 +00:00
virtual ~CIOWin() {}
2015-08-27 00:23:46 +00:00
CIOWin(const char* name) : m_name(name) {m_nameHash = std::hash<std::string>()(m_name);}
2015-08-26 01:34:56 +00:00
virtual EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&)=0;
2015-08-20 02:52:07 +00:00
virtual bool GetIsContinueDraw() const {return true;}
virtual void Draw() const {}
virtual void PreDraw() const {}
2015-08-26 01:34:56 +00:00
const std::string& GetName() const {return m_name;}
size_t GetNameHash() const {return m_nameHash;}
2015-08-18 05:54:43 +00:00
};
2015-08-26 01:34:56 +00:00
static bool operator==(rstl::rc_ptr<CIOWin> a, rstl::rc_ptr<CIOWin> b)
{
return a.get() == b.get();
}
2015-08-18 05:54:43 +00:00
}
#endif // __RETRO_CIOWIN_HPP__