API reference
API reference
Select your platform
No SDKs available
No versions available

OVR_Platform.h File

Overview

Macros

#define
ovr_Platform_InitializeStandaloneOculus
#define
ovr_PlatformInitializeWithAccessToken
#define
ovr_PlatformInitializeWindows
#define
ovr_PlatformInitializeWindowsAsynchronous

Functions

bool
const char *
ovr_Platform_InitializeStandaloneOculusEx
( const ovrOculusInitParams * params,
int productVersion,
int majorVersion )
ovr_PlatformInitializeWithAccessTokenEx
( ovrID appId,
const char * serviceAccessToken,
int productVersion,
int majorVersion )
ovr_PlatformInitializeWindowsEx
( const char * appId,
int productVersion,
int majorVersion )
ovr_PlatformInitializeWindowsAsynchronousEx
( const char * appId,
int productVersion,
int majorVersion )
const char *
void
void
ovr_SetDeveloperAccessToken
( const char * accessToken )

Details

Macros

#define ovr_Platform_InitializeStandaloneOculus
Wrapper for ovr_Platform_InitializeStandaloneOculusEx that automatically passes the key version information as defined in this header package. This is used to ensure that the version in your headers matches the version of the static library.
#define ovr_PlatformInitializeWithAccessToken
#define ovr_PlatformInitializeWindows
Wrapper for ovr_PlatformInitializeWindowsEx that automatically passes the key version information as defined in this header package. This is used to ensure that the version in your headers matches the version of the static library.
#define ovr_PlatformInitializeWindowsAsynchronous
Wrapper for ovr_PlatformInitializeWindowsAsynchronousEx that automatically passes the key version information as defined in this header package. This is used to ensure that the version in your headers matches the version of the static library.outResult will contain the result of attempting to load the DLL. If that fails, the returning ovrRequest will be 0.NOTE: Just because the DLL is loaded successfully does NOT mean that the initialization was successful, you still need to check the message queue for the result in ovrMessage_PlatformInitializeWindowsAsynchronous

Enumeration Types

enum OVR_Platform.h.ovrPlatformStructureType_
Enumerator
ovrPlatformStructureType_Unknown
= 0
ovrPlatformStructureType_OculusInitParams
= 1
enum OVR_Platform.h.ovrInitConfigOption_
Enumerator
ovrInitConfigOption_DisableP2pNetworking
= 0x1CDE5DDE
ovrInitConfigOption_EnableCowatching
= 0x7DD1C46E

Typedefs

typedef enum ovrPlatformStructureType_ ovrPlatformStructureType ( )
This enum describes the type of versionable structs in the Oculus Platform API. Older versions of structs will not be declared here, but they will be seamlessly updated for all supported older versions of the SDK.
typedef enum ovrInitConfigOption_ ovrInitConfigOption ( )
No description available.

Functions

bool ovr_IsPlatformInitialized ( )
No description available.
ovrKeyValuePair ovr_InitConfigOption_CreateBool
bool value )
No description available.
const char* ovrInitConfigOption_toString
( ovrInitConfigOption configOption )
No description available.
ovrRequest ovr_Platform_InitializeStandaloneOculusEx
( const ovrOculusInitParams * params,
int productVersion,
int majorVersion )
Initializes the SDK in Standalone mode and doesn't try to connect to a locally running Oculus Service process. Not all functionality will work when when the SDK is initialized this way. In particular: IAP, Cloud Storage, Parties, Events, Live Streaming. Listen for the message ovrMessage_Platform_InitializeStandaloneOculus to detect when the platform has finished initializing.
Parameters
params
non-nullptr to a struct with the required Oculus Authentication data.
ovrRequest ovr_PlatformInitializeWithAccessTokenEx
( ovrID appId,
const char * serviceAccessToken,
int productVersion,
int majorVersion )
(BETA) For use on platforms where the Oculus service isn't running. You'll need to know how to get an access token for the user to use this. While the platform is in an initializing state, it's not fully functional. [Requests]: will queue up and run once platform is initialized. For example: ovr_User_GetLoggedInUser() can be called immediately after asynchronous init and once platform is initialized, this request will run [Synchronous Methods]: will return the default value; For example: ovr_GetLoggedInUserID() will return 0 until platform is fully initialized
outResult will contain the result of attempting to load the DLL. If that fails, the returning ovrRequest will be 0.
NOTE: Just because the DLL is loaded successfully does NOT mean that the initialization was successful. Listen for the message ovrMessage_PlatformInitializeWithAccessToken to detect when the platform has finished initializing.
Not all functionality will work when when the SDK is initialized this way. In particular: In-App Purchases, Cloud Storage, Parties, Events, Live Streaming will not work.
ovrPlatformInitializeResult ovr_PlatformInitializeWindowsEx
( const char * appId,
int productVersion,
int majorVersion )
Performs the initialization of the platform for use on Windows. Requires your app ID (not access token). This call may fail for a variety of reasons, and will return an error code in that case. It is critical to respect this error code and either exit or make no further platform calls.
ovrRequest ovr_PlatformInitializeWindowsAsynchronousEx
( const char * appId,
int productVersion,
int majorVersion )
Performs the initialization of the platform for use on Windows. Requires your app ID (not access token). This call may fail for a variety of reasons, and will return an error code in that case. It is critical to respect this error code and either exit or make no further platform calls.
outResult will contain the result of attempting to load the DLL. If that fails, the returning ovrRequest will be 0.
NOTE: Just because the DLL is loaded successfully does NOT mean that the initialization was successful, you still need to check the message queue for the result in ovrMessage_PlatformInitializeWindowsAsynchronous
ovrID ovr_GetLoggedInUserID ( )
Returns the id of the currently logged in user, or a 0 id if there is none.
const char* ovr_GetLoggedInUserLocale ( )
Returns the currently logged-in user's locale as a string, or empty string on error. Return value format conforms to BCP47: https://tools.ietf.org/html/bcp47 The return value is borrowed, and should not be freed
ovrMessageHandle ovr_PopMessage ( )
Return the next message in the queue (FIFO order), or null if none is available. Safe to call on any thread. Each returned message should eventually be freed with ovr_FreeMessage.
TODO: comment on whether it's safe to process messages out of order.
void ovr_FreeMessage
No description available.
void ovr_SetDeveloperAccessToken
( const char * accessToken )
No description available.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon