|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
AxisCamera Declaration help
We need help with declaring our axiscamera.
We already declared it like this: Camera.cpp: Code:
AxisCamera &camera = AxisCamera::GetInstance(); Camera.h: Code:
AxisCamera *camera; Code:
&camera = AxisCamera::GetInstance(); How can we do this? |
|
#2
|
|||
|
|||
|
Re: AxisCamera Declaration help
We figured it out:
Camera.h: Code:
AxisCamera &camera; Code:
Camera::Camera():
camera(AxisCamera::GetInstance())
{
}
|
|
#3
|
|||
|
|||
|
Re: AxisCamera Declaration help
The whole idea behind a singleton and GetInstance is that you can just call GetInstance wherever you need to access the object. Just put a separate GetInstance call in whatever classes you need the camera object in.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|