MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / handleMenuKey

Method handleMenuKey

physx/samples/samplebase/PhysXSampleApplication.cpp:1307–1357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1305}
1306
1307bool PhysXSampleApplication::handleMenuKey(MenuKey::Enum menuKey)
1308{
1309 if (!mSelected)
1310 return false;
1311
1312 Test::TestGroup* parent = mSelected->getParent(), *child = NULL;
1313 PX_ASSERT(parent);
1314
1315 switch (menuKey)
1316 {
1317 case MenuKey::NAVI_LEFT:
1318 if (NULL != parent->getParent())
1319 mSelected = parent;
1320 break;
1321 case MenuKey::NAVI_RIGHT:
1322 if (NULL != (child = mSelected->getFirstChild()))
1323 mSelected = child;
1324 break;
1325 case MenuKey::NAVI_UP:
1326 if (NULL != (child = parent->getPreviousChild(*mSelected)))
1327 mSelected = child;
1328 else if (NULL != (child = parent->getLastChild()))
1329 mSelected = child;
1330 break;
1331 case MenuKey::NAVI_DOWN:
1332 if (NULL != (child = parent->getNextChild(*mSelected)))
1333 mSelected = child;
1334 else if (NULL != (child = parent->getFirstChild()))
1335 mSelected = child;
1336 break;
1337 case MenuKey::SELECT:
1338 if (mSelected->isTest())
1339 {
1340 mMenuExpand = false;
1341 mSwitchSample = true;
1342 mInputEventBuffer->clear();
1343 return false;
1344 }
1345 else
1346 {
1347 if (NULL != (child = mSelected->getFirstChild()))
1348 mSelected = child;
1349 }
1350 break;
1351 default:
1352 //mSelected = mRunning;
1353 break;
1354 }
1355
1356 return true;
1357}
1358
1359void PhysXSampleApplication::switchSample()
1360{

Callers

nothing calls this directly

Calls 7

getPreviousChildMethod · 0.80
getNextChildMethod · 0.80
isTestMethod · 0.80
getParentMethod · 0.45
getFirstChildMethod · 0.45
getLastChildMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected