What’s included?

The version 8.0.0 (released May 2022) package contains the following files and folders

FolderDescription
.netContains .cs and .dll files to use TGI in a .net application
binSimple test application to verify tracker connection and visualize signals
documentationDocumentation and API reference
includeHeader files for static and dynamic API loading
lib.lib and .dll files for x86 and x64
samplesSet of short C++ samples to load the API, connect to trackers, get data etc.
Getting Started SDLATobii Software Development License Agreement. Read more.

Minimal sample

The following sample demonstrates how easy it is to get hold of eye and head tracking data using TGI. More samples can be found in the samples folder.

 

#include "tobii_gameintegration.h"
#include <iostream>
#include "windows.h"
#include <thread>

using namespace TobiiGameIntegration;

void AllStreamsSample()
{
    ITobiiGameIntegrationApi* api = GetApi("Test Application");
    IStreamsProvider* streamsProvider = api->GetStreamsProvider();

    api->GetTrackerController()->TrackWindow(GetConsoleWindow());

    while(!GetAsyncKeyState(VK_ESCAPE))
    {
        api->Update();

        GazePoint gazePoint;
        if (streamsProvider->GetLatestGazePoint(gazePoint))
        {
            std::cout << "Gaze point: [" << gazePoint.X << ", " << gazePoint.Y << "]" << std::endl;
        }

        HeadPose headPose;
        if (streamsProvider->GetLatestHeadPose(headPose))
        {
            std::cout << "Head rotation(deg): [" << headPose.Rotation.YawDegrees << ", " << headPose.Rotation.PitchDegrees
                << "," << headPose.Rotation.RollDegrees << "]" << std::endl;
        }

        bool userIsPresent = streamsProvider->IsPresent();
        std::cout << "User Presence: " << userIsPresent << std::endl;

        Sleep(1000 / 60);
    }

    api->Shutdown();
}