Cursor.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00029 #ifndef _GG_Cursor_h_
00030 #define _GG_Cursor_h_
00031
00032 #include <GG/PtRect.h>
00033
00034 #include <boost/shared_ptr.hpp>
00035
00036
00037 namespace GG {
00038
00039 class Texture;
00040
00046 class GG_API Cursor
00047 {
00048 public:
00050 Cursor();
00051 virtual ~Cursor();
00052
00053
00055
00057 virtual void Render(const Pt& pt) = 0;
00059
00060 private:
00061 friend class boost::serialization::access;
00062 template <class Archive>
00063 void serialize(Archive& ar, const unsigned int version);
00064 };
00065
00071 class GG_API TextureCursor :
00072 public Cursor
00073 {
00074 public:
00076
00079 TextureCursor(const boost::shared_ptr<Texture>& texture, const Pt& hotspot = Pt());
00081
00083 virtual void Render(const Pt& pt);
00085
00086 private:
00087 boost::shared_ptr<Texture> m_texture;
00088 Pt m_hotspot;
00089
00090 friend class boost::serialization::access;
00091 template <class Archive>
00092 void serialize(Archive& ar, const unsigned int version);
00093 };
00094
00095 }
00096
00097
00098 template <class Archive>
00099 void GG::Cursor::serialize(Archive& ar, const unsigned int version)
00100 {}
00101
00102 template <class Archive>
00103 void GG::TextureCursor::serialize(Archive& ar, const unsigned int version)
00104 {
00105 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Cursor)
00106 & m_texture
00107 & m_hotspot;
00108 }
00109
00110 #endif // _GG_Cursor_h_