vp_init

From Virtual Paradise Wiki
Revision as of 19:05, 16 December 2016 by Sleepy E (talk | contribs) (No longer required, VP_BUILD => VPSDK_VERSION)
Jump to navigation Jump to search
Method call snippet vp_init(VPSDK_VERSION);

Check if the version of the VPSDK used to build the application matches the version that is currently loaded.

Parameters

These are the parameters that this method requires:

Parameter Usage
int
version
VPSDK_VERSION in VP.h defines the version of the SDK library

Returns

This method returns a return code integer, which indicates whether the call was successful or errored for any reason:

Return code Cause
VP_RC_SUCCESS Successful call (for methods that have a registered callback, it only means the request has been sent)
VP_RC_VERSION_MISMATCH VP.h and the SDK library are from different builds

Behavior

This only has to be called once for every application. It is used to check if the version used to build the application is compatible with the version used at runtime.

Examples

int rc;
if(rc = vp_init(VPSDK_VERSION))
    printf("Error initializing VP API (reason %d)\n", rc);

See also