// FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown
//
//! DESCRIPTION: This API creates a stereo handle that is used in subsequent calls related to a given device interface.
//! This must be called before any other NvAPI_Stereo_ function for that handle.
//! Multiple devices can be used at one time using multiple calls to this function (one per each device).
//!
//! HOW TO USE: After the Direct3D device is created, create the stereo handle.
//! On call success:
//! -# Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter.
//! -# After the device interface that corresponds to the the stereo handle is destroyed,
//! the application should call NvAPI_DestroyStereoHandle() for that stereo handle.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] pDevice Pointer to IUnknown interface that is IDirect3DDevice9* in DX9, ID3D10Device*.
//! \param [out] pStereoHandle Pointer to the newly created stereo handle.
//!
//! \retval ::NVAPI_OK Stereo handle is created for given device interface.
//! \retval ::NVAPI_INVALID_ARGUMENT Provided device interface is invalid.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API activates stereo for the device interface corresponding to the given stereo handle.
//! Activating stereo is possible only if stereo was enabled previously in the registry.
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
//! and will return the appropriate error code.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle corresponding to the device interface.
//!
//! \retval ::NVAPI_OK Stereo is turned on.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API deactivates stereo for the given device interface.
//! If stereo is not activated, then calls to functions that require that stereo is activated have no effect,
//! and will return the appropriate error code.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//!
//! \retval ::NVAPI_OK Stereo is turned off.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API checks if stereo is activated for the given device interface.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] pIsStereoOn Address where result of the inquiry will be placed.
//!
//! \retval ::NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off).
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_ERROR - Something is wrong (generic error).
//! DESCRIPTION: This API gets current separation value (in percents).
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pSeparationPercentage Address of @c float type variable to store current separation percentage in.
//!
//! \retval ::NVAPI_OK Retrieval of separation percentage was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API sets separation to given percentage.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] newSeparationPercentage New value for separation percentage.
//!
//! \retval ::NVAPI_OK Setting of separation percentage was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED NVAPI not initialized.
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! \retval ::NVAPI_STEREO_PARAMETER_OUT_OF_RANGE Given separation percentage is out of [0..100] range.
//! DESCRIPTION: This API gets the current convergence value.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [out] pConvergence Address of @c float type variable to store current convergence value in.
//!
//! \retval ::NVAPI_OK Retrieval of convergence value was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API sets convergence to the given value.
//!
//! WHEN TO USE: After the stereo handle for the device interface is created via successfull call to the appropriate NvAPI_Stereo_CreateHandleFrom() function.
//!
//! SUPPORTED OS: Windows Vista and higher
//!
//!
//! \since Release: 180
//!
//! \param [in] stereoHandle Stereo handle that corresponds to the device interface.
//! \param [in] newConvergence New value for convergence.
//!
//! \retval ::NVAPI_OK Setting of convergence value was successfull.
//! \retval ::NVAPI_STEREO_INVALID_DEVICE_INTERFACE Device interface is not valid. Create again, then attach again.
//! \retval ::NVAPI_API_NOT_INTIALIZED
//! \retval ::NVAPI_STEREO_NOT_INITIALIZED Stereo part of NVAPI not initialized.
//! DESCRIPTION: This API defines the stereo profile used by the driver in case the application has no associated profile.
//!
//! WHEN TO USE: To take effect, this API must be called before D3D device is created. Calling once a device has been created will not affect the current device.