Reference Counting and Ptr<>
Hey Rift Peeps.
In reading through the OVR docs there is mention of reference counting. And in looking at the example code I see that the OVR::Ptr<> template is used throughout. I was wondering if the SDK reference counting then depends on the use of the OVR::Ptr<> template, or is it internal to the device (and device manager) objects themselves when they are created?
For example, when using the DeviceManager class could I do something like this (just an example thrown together here)?
Or is using the OVR::Ptr<> template a requirement for working with all device objects, including the manager?
Thanks!
- Dave
In reading through the OVR docs there is mention of reference counting. And in looking at the example code I see that the OVR::Ptr<> template is used throughout. I was wondering if the SDK reference counting then depends on the use of the OVR::Ptr<> template, or is it internal to the device (and device manager) objects themselves when they are created?
For example, when using the DeviceManager class could I do something like this (just an example thrown together here)?
class OVRManager
{
protected:
OVR::DeviceManger* mDeviceManager;
public:
OVRManager()
{
mDeviceManager = OVR::DeviceManager::Create();
}
virtual ~OVRManager()
{
mDeviceManager->Release();
}
};
Or is using the OVR::Ptr<> template a requirement for working with all device objects, including the manager?
Thanks!
- Dave
