55 "Center the joystick then press a button for more than 0.2s",
56 "Steer left then press a button for more than 0.2s",
57 "Steer right then press a button for more than 0.2s",
58 "Apply full throttle then press a button for more than 0.2s",
59 "Apply full brake then press a button for more than 0.2s",
60 "Apply full clutch then press a button for more than 0.2s",
61 "Calibration successfully done",
68 static const char *
LabName[] = {
"Steer",
"Throttle",
"Brake",
"Clutch" };
93 const int BUFSIZE = 1024;
108 snprintf(buf, BUFSIZE,
"%.2g",
ax[axis]);
117 snprintf(buf, BUFSIZE,
"%.2g",
ax[axis]);
128 snprintf(buf, BUFSIZE,
"%.2g",
axCenter[axis]);
130 snprintf(buf, BUFSIZE,
"%.2g",
ax[axis]);
145 const double delay = 0.2;
147 for (index = 0; index <
NUM_JOY; index++) {
149 js[index]->read(&b, &
ax[index * _JS_MAX_AXES]);
153 for (i = 0, mask = 1; i < 32; i++, mask *= 2) {
154 if (((b & mask) != 0) && ((
rawb[index] & mask) == 0)) {
192 for (index = 0; index <
NUM_JOY; index++) {
194 js[index]->read(&
rawb[index], &
ax[index * _JS_MAX_AXES]);
200 for (i = 0; i < 4; i++) {
219 int x,
y, dy, i, index;
240 for (i = 0; i < 4; i++) {
248 for (index = 0; index <
NUM_JOY; index++) {
249 if (
js[index] == NULL) {
250 js[index] =
new jsJoystick(index);
253 if (
js[index]->notWorking()) {
static const char * Instructions[]
int GfuiButtonCreate(void *scr, const char *text, int font, int x, int y, int width, int align, int mouse, void *userDataOnPush, tfuiCallback onPush, void *userDataOnFocus, tfuiCallback onFocus, tfuiCallback onFocusLost)
Add a button to a screen.
static float ax[_JS_MAX_AXES *NUM_JOY]
bool GfctrlIsEventBlacklisted(void *parmHandle, const char *driversSection, const char *event)
Check if given event is blacklisted (used for buttons or axis which fire a button AND move event)...
static void JoyCalAutomaton(void)
static void advanceStep(void)
Robot Module Interface Definition.
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
void GfuiIdle(void)
Idle function for the GUI to be called during Idle loop of glut.
static void onBack(void *prevMenu)
static const char * LabName[]
The Gaming Framework API (client part).
static jsJoystick * js[NUM_JOY]
void * GfuiScreenCreateEx(float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
Create a screen.
void GfuiLabelSetText(void *scr, int id, const char *text)
Change the text of a label.
static float axCenter[_JS_MAX_AXES *NUM_JOY]
const char * GfctrlGetNameByRef(GfCtrlType type, int index)
Get a control name by its reference.
void * JoyCalMenuInit(void *prevMenu, tCmdInfo *cmd, int maxcmd, void *parmhandle, const char *driversection)
static double axisPressedTime
Parameter set handle structure, multiple handles can reference the same parameter set...
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
void(* tfuiCallback)(void *)
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
double GfTimeClock(void)
Get the time in seconds.
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
static void onActivate(void *)
static const char * driverSection
Track Structure and Track Loader Module Definition.