Skip to main content

Wyvrn C++ SDK

The WYVRN SDK has a C++ library to integrate with AI, Chroma, and haptics.

About

The WYVRN SDK is a game plugin DLL that is shared to provide a common API for naming events and triggering external AI, Chroma playback and haptic events.

Security

To avoid a 3rd party injecting malicious code, the plugin checks for a valid signature on the Razer Chromatic Library. The DLL issuer is validated to be Razer USA Ltd. Init and InitSDK will return RZRESULT_DLL_INVALID_SIGNATURE if the signature check fails.

General

  • The WYVRN SDK allows an application or game to set the details in the Chroma Apps list within the Chroma App.

This document provides a guide to integrating AI, Chroma, and haptics using the WYVRN C++ SDK. Here is the list of available methods from the API:

WYVRN SDK

The WYVRN SDK is the combination of AI, Chroma, and Razer Sensa HD Haptics in a single SDK. By integrating AI, RGB lighting and haptics into game environments and events, players can enjoy a truly immersive gaming experience. The WYVRN SDK is capable of playing Chroma animations and haptics on the Razer Sensa HD Haptics devices. SetEventName() can trigger AI interaction, RGB lighting, or haptics or all of the above.

image-8

Downloads

SDKs

  • WYVRN SDK
EngineGit RepoDownload LinkGit RepoDownload LinkGit RepoDownload Link
EncodingUNICODEASCIIMULTI-BYTE
WYVRN Design TemplateGitDownload
WYVRN C++ SDKGitDownloadGitDownloadGitDownload
WYVRN Unreal SDKGitDownload
WYVRN Unity SDKGitDownload

Event names can follow a naming convention which assists with the generation of the event configuration for your title. Event names are specified with the SetEventName() method. The event name suffix can be left off or used to prepopulate common settings for _ON, _OFF, and _MERGE.

  • "Jump" - (without a suffix) Existing haptics stop, the named haptic plays to completion and then ends

  • "Attack_ON" - Existing haptics continue to play, the named haptic plays as a continuous looping haptic

  • "Attack_OFF" - Existing haptics continue to play, the named looping haptic stops

  • "Punch_MERGE" - Existing haptics continue to play, the named haptic plays to completion and ends

  • "Block_MERGE" - Existing haptics continue to play, the named haptic plays to completion and ends

Upon completion of event implementation, the list of Chroma events and game triggers should be shared with the team for QA to verify they execute as expected.

Targeting features can be optionally described for each haptics effect.

Namespace

Add the WYVRN SDK namespace to use the API.

using namespace WyvrnSDK;

API Class

The WyvrnAPI class provides a wrapper for the WyvrnSDK Library. The API can be added with WyvrnAPI.h.

#include "Razer\WyvrnAPI.h"

Initialize SDK

Initialize the WYVRN SDK in order to utilize the API. The InitSDK method takes an AppInfo parameter which defines the application or game details that will appear in Synapse and the Chroma App within the Chroma Apps tab. The expected return result should be RZRESULT_SUCCESS which indicates the API is ready for use. If a non-success result is returned, the WYVRN implementation should be disabled until the next time the application or game is launched. Reasons for failure are likely to be the user does not have the Synapse or the Chroma App installed. After successfully initializing the WYVRN SDK, wait approximately 100 ms before setting events.

image-5

 APPINFOTYPE appInfo = {};

_tcscpy_s(appInfo.Title, 256, _T("Sample Game Title"));
_tcscpy_s(appInfo.Description, 1024, _T("Sample Game Description"));
_tcscpy_s(appInfo.Author.Name, 256, _T("Company Name"));
_tcscpy_s(appInfo.Author.Contact, 256, _T("Company Website or Email"));

// 0x01 | // Utility. (To specifiy this is an utility application)
// 0x02 // Game. (To specifiy this is a game);
appInfo.Category = 0x02;

RZRESULT result = WyvrnAPI::CoreInitSDK(&appInfo);
if (result == RZRESULT_SUCCESS)
{
// Init Success! Ready to use the WYVRN SDK!
}
else
{
// Init Failed! Stop using the WYVRN SDK until the next game launch!";
}

Set Event Name

Chroma events can be named to add supplemental technology to your lighting experience. By naming game events and game triggers, the event name can be used as a lookup to play things like haptics effects. SetEventName(L"Jump") could be used when playing a Chroma animation of a jump effect. Using L"Jump" a corresponding haptic effect can be added with the Chroma effect to enhance emersion for the title. No other APIs are required to add haptics effects other than to invoke SetEventName(). To stop haptics playback use SetEventName(L"") with an empty string. Chroma does not need to be playing in order to trigger haptics manually with SetEventName().

// Trigger haptic effect
int result = WyvrnAPI::CoreSetEventName(L"Jump");
if (result == RZRESULT_SUCCESS)
{
// Chroma event named successfully!"
}
else
{
// Unable to set event name. Unexpected result!"
}

// Stop haptic playback
result = WyvrnAPI::CoreSetEventName(L"");
if (result == RZRESULT_SUCCESS)
{
// Haptics stopped successfully!"
}
else
{
// Unable to stop haptics. Unexpected result!"
}

Uninitialize SDK

Applications should uninitialize the WYVRN SDK with Uninit() for a clean exit. Uninitialization is only needed if the WYVRN SDK was successfully initialized. The expected successful return result should be RZRESULT_SUCCESS.

int result = WyvrnAPI::CoreUninit();
if (result == RZRESULT_SUCCESS)
{
// WYVRN has been uninitialized!
}
else
{
// WYVRN uninitialization was unsuccessful!
}

Frameworks supported

  • Windows WyvrnSDK (32-bit)

  • Windows WyvrnSDK (64-bit)


Assets

A game uses SetEventName to name game triggers. No other assets need to be included in the game to add haptics and lighting effects. Playback is controlled from the external Events.config for the named events.

Full API


PluginCoreInitSDK

Direct access to low level API.

// DLL Interface
EXPORT_API RZRESULT PluginCoreInitSDK(
ChromaSDK::APPINFOTYPE* AppInfo);

// Class Plugin
RZRESULT result = WyvrnAPI::CoreInitSDK(
ChromaSDK::APPINFOTYPE* AppInfo);

PluginCoreSetEventName

Direct access to low level API.

// DLL Interface
EXPORT_API RZRESULT PluginCoreSetEventName(LPCTSTR Name);

// Class Plugin
RZRESULT result = WyvrnAPI::CoreSetEventName(LPCTSTR Name);

PluginCoreUnInit

Direct access to low level API.

// DLL Interface
EXPORT_API RZRESULT PluginCoreUnInit();

// Class Plugin
RZRESULT result = WyvrnAPI::CoreUnInit();