Mouse Input test stuff
This commit is contained in:
@@ -53,9 +53,14 @@ bool firstTime = true;
|
||||
FFmpeg* g_pFFmpegVideoRecorder = nullptr;
|
||||
|
||||
|
||||
// Input Stuff
|
||||
float lastX;
|
||||
float lastY;
|
||||
|
||||
|
||||
void initTweakBar(){
|
||||
g_pDUC->g_pTweakBar = TwNewBar("TweakBar");
|
||||
TwDefine(" TweakBar color='0 128 128' alpha=128 ");
|
||||
TwDefine(" TweakBar color='128 128 128' alpha=128 ");
|
||||
TwType TW_TYPE_TESTCASE = TwDefineEnumFromString("Test Scene", g_pSimulator->getTestCasesStr());
|
||||
TwAddVarRW(g_pDUC->g_pTweakBar, "Test Scene", TW_TYPE_TESTCASE, &g_iTestCase, "");
|
||||
// HINT: For buttons you can directly pass the callback function as a lambda expression.
|
||||
@@ -202,10 +207,23 @@ void CALLBACK OnMouse( bool bLeftButtonDown, bool bRightButtonDown, bool bMiddle
|
||||
if (bLeftButtonDown)
|
||||
{
|
||||
g_pSimulator->onClick(xPos,yPos);
|
||||
|
||||
int x = xPos;
|
||||
int y = yPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_pSimulator->onMouse(xPos, yPos);
|
||||
|
||||
float deltaX = lastX - xPos;
|
||||
float deltaY = lastY - yPos;
|
||||
|
||||
lastX = xPos;
|
||||
lastY = yPos;
|
||||
|
||||
/*printf("X Delta: %f \n", deltaX);
|
||||
printf("Y Delta: %f \n", deltaY);*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user