| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#ifndef OSGXR_INTERACTION_PROFILE |
| 5 |
#define OSGXR_INTERACTION_PROFILE 1 |
| 6 |
|
| 7 |
#include <osgXR/InteractionProfile> |
| 8 |
|
| 9 |
#include <osg/observer_ptr> |
| 10 |
#include <osg/ref_ptr> |
| 11 |
|
| 12 |
#include <list> |
| 13 |
#include <string> |
| 14 |
|
| 15 |
namespace osgXR { |
| 16 |
|
| 17 |
class XRState; |
| 18 |
|
| 19 |
namespace OpenXR { |
| 20 |
class InteractionProfile; |
| 21 |
class Path; |
| 22 |
class Session; |
| 23 |
}; |
| 24 |
|
| 25 |
class InteractionProfile::Private |
| 26 |
{ |
| 27 |
public: |
| 28 |
|
| 29 |
static Private *get(InteractionProfile *pub) |
| 30 |
{ |
| 31 |
return pub->_private.get(); |
| 32 |
} |
| 33 |
|
| 34 |
Private(InteractionProfile *pub, |
| 35 |
XRState *newState, |
| 36 |
const std::string &newVendor, |
| 37 |
const std::string &newType); |
| 38 |
~Private(); |
| 39 |
|
| 40 |
void suggestBinding(Action *action, const std::string &binding); |
| 41 |
|
| 42 |
bool getUpdated() const |
| 43 |
{ |
| 44 |
return _updated; |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
bool setup(OpenXR::Instance *instance); |
| 49 |
|
| 50 |
void cleanupInstance(); |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
InteractionProfile *getPublic() |
| 56 |
{ |
| 57 |
return _pub; |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
const std::string &getVendor() const |
| 62 |
{ |
| 63 |
return _vendor; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
const std::string &getType() const |
| 68 |
{ |
| 69 |
return _type; |
| 70 |
} |
| 71 |
|
| 72 |
OpenXR::Path getPath() const; |
| 73 |
|
| 74 |
private: |
| 75 |
|
| 76 |
InteractionProfile *_pub; |
| 77 |
osg::observer_ptr<XRState> _state; |
| 78 |
std::string _vendor; |
| 79 |
std::string _type; |
| 80 |
|
| 81 |
struct Binding { |
| 82 |
osg::ref_ptr<Action> action; |
| 83 |
std::string binding; |
| 84 |
}; |
| 85 |
std::list<Binding> _bindings; |
| 86 |
|
| 87 |
bool _updated; |
| 88 |
osg::ref_ptr<OpenXR::InteractionProfile> _profile; |
| 89 |
}; |
| 90 |
|
| 91 |
} |
| 92 |
|
| 93 |
#endif |