adInitialize
Create an SDK instance.
- AdResult adInitialize(
- const AdInitParams* theInitParams,
- AdInterfacePtr * theInterfaceOut );
Routine | Required Header | Distribution |
---|---|---|
adInitialize | <ad.h> | SDKZIP |
Return Value
This function returns AdResult_NO_ERROR upon success. Otherwise a valid AdResult error condition is returned. (see remarks)
Parameters
- theInitParams
- [in] Structure with SDK runtime settings
- theInterfaceOut
- [out] AdInterfacePtr to be initialized
Remarks
This function will initialize an AdInterfacePtr which may then be passed to the Ad SDK interface functions.
The AdInitParams parameter is a structure of SDK runtime options. Please see the developer guide documentation for a description of each field.
Example
AdInterfacePtr anInterface = NULL;
AdResult aResult = AdResult_NO_ERROR;
// Set run-time parameters
AdInitParams anInitParams;
memset(&anInitParams;, 0, sizeof(AdInitParams));
anInitParams.mGameId = GAME_ID;
anInitParams.mOfflineFilePath = "ad";
printf("Initializing the Ad SDK\r\n");
aResult = adInitialize(&anInitParams;, &anInterface;);
if (aResult != AdResult_NO_ERROR)
{
printf("adInitialize failed (%d)\r\n", aResult);
return 0;
}
Section Reference: Gamespy Advertising SDK
See Also: adRegisterPosition, adThink, adShutdown