Skip to content

Instantly share code, notes, and snippets.

@qlyoung
Last active November 27, 2019 02:31
Show Gist options
  • Save qlyoung/74874c7e39b4897258f38cde2c7e119a to your computer and use it in GitHub Desktop.
Save qlyoung/74874c7e39b4897258f38cde2c7e119a to your computer and use it in GitHub Desktop.
Display code for hooked ovr_GetInputState
ovrResult mygis(ovrSession session, ovrControllerType controllerType, ovrInputState* inputState)
{
ovrResult r = gis(session, controllerType, inputState);
ovrVector2f lh = inputState->Thumbstick[0];
ovrVector2f rh = inputState->Thumbstick[1];
if (controllerType == ovrControllerType_Touch) {
int resx = 500;
int resy = 500;
const unsigned char red[] = { 255, 0, 0 };
const unsigned char green[] = { 0, 0, 255 };
CImg<unsigned char> graph(resx, resy, 1, 3, 1);
graph.draw_circle((resx / 2.0), (resy / 2.0), resx / 2.0, green, 0.5);
graph.draw_circle((rh.x * resx) / 2.0 + (resx / 2.0), -((rh.y * resy) / 2.0) + (resy / 2.0), 10, red, 1);
disp.display(graph);
}
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment