Rev | Line | |
---|
[12334] | 1 | #ifndef MOUSEAPICURSOR_H |
---|
| 2 | #define MOUSEAPICURSOR_H |
---|
| 3 | #include <overlays/OrxonoxOverlay.h> |
---|
[12348] | 4 | #include "core/CoreIncludes.h" |
---|
[12363] | 5 | #include "tools/interfaces/Tickable.h" |
---|
| 6 | #include "overlays/OverlayGroup.h" |
---|
| 7 | #include "mouseapi.h" |
---|
| 8 | #include "core/XMLPort.h" |
---|
[12334] | 9 | |
---|
[12363] | 10 | |
---|
| 11 | #if OGRE_VERSION >= 0x010900 |
---|
| 12 | # include <Overlay/OgreOverlayManager.h> |
---|
| 13 | # include <Overlay/OgrePanelOverlayElement.h> |
---|
| 14 | #else |
---|
| 15 | # include <OgreOverlayManager.h> |
---|
| 16 | # include <OgrePanelOverlayElement.h> |
---|
| 17 | #endif |
---|
| 18 | |
---|
| 19 | #include "tools/TextureGenerator.h" |
---|
| 20 | #include "util/StringUtils.h" |
---|
| 21 | |
---|
[12348] | 22 | namespace orxonox{ |
---|
[12334] | 23 | |
---|
[12363] | 24 | class MouseAPICursor: public OrxonoxOverlay, public Tickable |
---|
[12334] | 25 | { |
---|
[12363] | 26 | private: |
---|
| 27 | Ogre::PanelOverlayElement* cursor; |
---|
| 28 | bool running = false; |
---|
| 29 | std::string cursorname = "cursor.png"; |
---|
[12334] | 30 | public: |
---|
| 31 | MouseAPICursor(Context* context); |
---|
[12363] | 32 | ~MouseAPICursor(); |
---|
| 33 | virtual void tick(float dt) override; |
---|
| 34 | virtual void XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) override; |
---|
| 35 | inline void setCursorName(const std::string& name) |
---|
| 36 | { |
---|
| 37 | cursorname = name; |
---|
| 38 | cursor->setMaterialName(TextureGenerator::getMaterialName( |
---|
| 39 | cursorname, Ogre::ColourValue::White)); |
---|
| 40 | } |
---|
| 41 | inline std::string getCursorName(void) const |
---|
| 42 | { |
---|
| 43 | return cursorname; |
---|
| 44 | } |
---|
| 45 | |
---|
[12334] | 46 | }; |
---|
| 47 | |
---|
[12348] | 48 | } |
---|
| 49 | |
---|
[12334] | 50 | #endif // MOUSEAPICURSOR_H |
---|
Note: See
TracBrowser
for help on using the repository browser.