Line | |
---|
1 | #ifndef MOUSEAPICURSOR_H |
---|
2 | #define MOUSEAPICURSOR_H |
---|
3 | #include <overlays/OrxonoxOverlay.h> |
---|
4 | #include "core/CoreIncludes.h" |
---|
5 | #include "tools/interfaces/Tickable.h" |
---|
6 | #include "overlays/OverlayGroup.h" |
---|
7 | #include "mouseapi.h" |
---|
8 | #include "core/XMLPort.h" |
---|
9 | |
---|
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 | |
---|
22 | namespace orxonox{ |
---|
23 | |
---|
24 | class MouseAPICursor: public OrxonoxOverlay, public Tickable |
---|
25 | { |
---|
26 | private: |
---|
27 | Ogre::PanelOverlayElement* cursor; |
---|
28 | bool running = false; |
---|
29 | std::string cursorname = "cursor.png"; |
---|
30 | public: |
---|
31 | MouseAPICursor(Context* context); |
---|
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 | |
---|
46 | }; |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | #endif // MOUSEAPICURSOR_H |
---|
Note: See
TracBrowser
for help on using the repository browser.