C++ Java Unity
C++ Reference
Device Class Referenceabstract

Detailed Description

Singleton representation of the device Vuforia is currently running on.

Vuforia supports many different hardware configurations. This class provides management and configuration functions for the specific configuration that Vuforia is currently running on.

Changes made here primarily affect how the RenderingPrimitives are created and structured.

Inheritance diagram for Device:
NonCopyable EyewearDevice

Public Member Functions

virtual Type getType () const =0
 Get the Type of this instance (may be a subclass of Device). More...
 
virtual bool isOfType (Type type) const =0
 Get whether this Device instance's type equals or has been derived from the given type. More...
 
virtual void setConfigurationChanged ()=0
 Tell Vuforia that the configuration has changed, so new RenderingPrimitives need to be generated. More...
 
virtual const RenderingPrimitives getRenderingPrimitives ()=0
 Get a copy of the RenderingPrimitives for the current configuration. More...
 

Static Public Member Functions

static DevicegetInstance ()
 Get the singleton instance. More...
 
static Type getClassType ()
 Get the Type for class "Device". More...
 

Member Function Documentation

static Device& getInstance ( )
static

Get the singleton instance.

This function can be used immediately after Vuforia::init() has succeeded. See the "Lifecycle of a Vuforia app" section on the main Vuforia reference page for more information. Lifecycle of a Vuforia app

static Type getClassType ( )
static

Get the Type for class "Device".

virtual Type getType ( ) const
pure virtual

Get the Type of this instance (may be a subclass of Device).

virtual bool isOfType ( Type  type) const
pure virtual

Get whether this Device instance's type equals or has been derived from the given type.

virtual void setConfigurationChanged ( )
pure virtual

Tell Vuforia that the configuration has changed, so new RenderingPrimitives need to be generated.

virtual const RenderingPrimitives getRenderingPrimitives ( )
pure virtual

Get a copy of the RenderingPrimitives for the current configuration.

The RenderingPrimitives returned from this function are immutable, and tailored to the current device environment.

RenderingPrimitives can be retrieved at the earliest after the first call to Vuforia::onSurfaceChanged().

New RenderingPrimitives will be created whenever the device environment changes in one of the following ways:

If you have cached a copy of the RenderingPrimitives and you make any of the above changes, you will need use this method to get an updated copy of the RenderingPrimitives that reflects the new device environment.

Note
Platform-specific lifecycle transitions (e.g. Pause/Resume) may also cause the configuration to change, so it is advisable to retrieve new RenderingPrimitives after those transitions.
RenderingPrimitives will not be valid until a CameraDevice has been initialised.
This method returns a copy, which has an associated cost. Performant apps should avoid calling this method if the configuration has not changed.