Page 1 of 1

Example on C++ API

PostPosted: Tue Jun 04, 2019 10:26 pm
by Ketechi
Hello everyone,

I have a T1 and a T2, I would like to use the T1 API on Visual Studio C++ but to be honest I am new on Visual Studio and C++. I was wondering if someone could give me an example on how to write a simple command.

The command I would like to try is something like this:

if (FFB_1 > 20.0)
set(XB1_RT, 100.0)

The code above is very simple in GtunerIV but I do not know how I would write that in C++ and also I am not sure if I have to create a Header file and include the file in "Direct API Template.cpp" or I write my code inside the "Direct API Template.cpp".

Any help will be appreciated :joia:

Re: Example on C++ API

PostPosted: Wed Jun 05, 2019 4:41 pm
by J2Kbr
Assuming you are using the template code as base, the GPC script you posted above can be reproduced in C++ like this:
Code: Select all
if(report.rumble[0] > 20) {
    output[XB1_RT] = 100;