Skip to main content

Windows

Introduction#

If you are using a non-supported or a custom engine, we also provide the Antidote SDK library so you can directly access its validation and watermark methods.

note

Touches are only available for Android and iOS.

Configuration#

To integrate the SDK for Custom Engines in your project:

  1. Download the latest version of Antidote SDK for Custom Windows Engines.
  2. Unzip the downloaded file and go to "custom engine" folder.
  3. You will find the antidote.dll library and headers. Include them to your project.

Validation#

bool validate_session();

Example:

myCustomCode.cpp
#include "antidote.hpp"
int main( int argc, char* argv[] ) {
bool isValid = antidote::session().validate_session();
if ( isValid ) {
// the session is authorized
} else {
// the session is not authorized, exit game.
}
}

User Information#

To access the Antidote User ID of the user opening the game, you can use the following function:

std::string get_user_id();

The returned string is the user ID.

Watermarks#

Configuration#

The watermark handler is automatically instantiated when you reference the Antidote session in the SDK, and will automatically be destructored on shutdown.

features::watermark::watermark * get_watermark();

The watermark handler needs to be configured before you attempt to render any watermark text. You will need to set the following values:

  • text velocity (how quickly the watermark moves on screen)
  • update speed (how often the watermark behaviour needs to be updated)
  • text width and height
  • screen width and height

Assuming your game screen is rendered to a 1920x1080 buffer and your text measures 128x32, you would make the following calls to get everything set up:

antidote::session().get_watermark()->set_speed(70); // move 70px per second
antidote::session().get_watermark()->set_change_position_timer(60); // update watermark behaviour every 60s
antidote::session().get_watermark()->set_canvas_dimensions(1920, 1080);
antidote::session().get_watermark()->set_text_dimensions(128, 32);
antidote::session().get_watermark()->set_behaviour(antidote::features::watermark::watermark_behaviour_type::TICKER);

Once configured, your engine will need to tell the watermark handler when to update. You will need to know the amount of time in milliseconds that has elapsed since the last call to the watermark handler update. Assuming this time span is a float called delta you can add the following to your game loop update:

antidote::session().get_watermark()->update(delta);

Finally, you will need to add some code to your render function to draw the watermark text. The following call will return a list of text items to be rendered:

std::vector<antidote::features::watermark::render_item> items = antidote::session().get_watermark()->get_render_list();
for (antidote::features::watermark::render_item item : items) {
// add call to draw text at (item.position.x, item.position.y)
}

Behaviours#

The following behaviours are supported:

BehaviourDescription
TICKERMove a single repeated line of text across the screen from right to left, which randomizes vertical position on every update cycle.
DVDBounce a single line of text around the screen.
MULTILINE_TICKERMove multiple lines of text across the screen from right to left.
RANDOMswitch to a different behaviour on every update cycle.

Game Events#

Events can be emitted during gameplay to track once-off events, and the duration of long-running events. These can be viewed on the session recording. To emit an event:

antidote::session().send_event("action", "eventName");

where action can be one of the following:

ActionDescription
startmark the start of a long-running event (e.g. boss_battle)
endmark the end of a long-running event (e.g. boss_battle)
onceemit a once-off event (e.g. collected_powerup)