Skip to content

Functions - Initialization


Functions

is_platform_initialized

is_platform_initialized()

Returns: A bool that is true if the platform is already initialized and false otherwise.

Example
1
2
3
4
5
6
if not GDOculusPlatform.is_platform_initialized():
    # Try to initialize the platform synchronously.
    var platform_initialized : bool = GDOculusPlatform.initialize_android("31415926535")

    if not platform_initialized:
        print("Unable to initialize Oculus Platform")

initialize_android

initialize_android(app_id : String, options : Dictionary)

Requests the Oculus Platform initialization synchronously. Keep in mind that this function will block the main loop until this function returns.

Returns: A bool that is true if the platform was initialized correctly or false otherwise.

Options (optional):

Key Value type Description
disable_p2p_networking bool Disables/enables the initialization of the WebRTC networking stack, only used for VoIP & Networking (both deprecated).
Example
1
2
3
4
5
6
7
var platform_initialized : bool = GDOculusPlatform.initialize_android("31415926535")

# Other example:
var options : Dictionary = {
    "disable_p2p_networking": true
}
var platform_initialized : bool = GDOculusPlatform.initialize_android("31415926535", options)

initialize_android_async

initialize_android_async(app_id : String)

Requests the Oculus Platform initialization asynchronously. This is the preferred way of initializing the platform.

Returns: A GDOculusPlatformPromise that will contain a true bool as a response if fulfilled. An error message will be available if rejected/couldn't initialize.

Example
1
2
3
4
5
6
7
GDOculusPlatform.initialize_android_async("31415926535")\
.then(func(platform_initialized : bool):
    print("Platform initialized!")
)\
.error(func(platform_initialized_err):
    print("Platform NOT initialized. Error message: ", platform_initialized_err)
)