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

Method inputInfoMsg

physx/samples/samplebase/PhysXSampleApplication.cpp:267–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267const char* PhysXSampleApplication::inputInfoMsg(const char* firstPart,const char* secondPart, PxI32 inputEventId1, PxI32 inputEventId2)
268{
269 const char* keyNames1[5];
270
271 PxU32 inputMask = 0;
272 if(m_platform->getSampleUserInput()->gamepadSupported() && m_platform->getSampleUserInput()->keyboardSupported())
273 {
274 inputMask = KEYBOARD_INPUT | GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
275 }
276 else
277 {
278 if(m_platform->getSampleUserInput()->gamepadSupported())
279 {
280 inputMask = GAMEPAD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
281 }
282
283 if(m_platform->getSampleUserInput()->keyboardSupported())
284 {
285 inputMask = KEYBOARD_INPUT | TOUCH_PAD_INPUT | MOUSE_INPUT;
286 }
287 }
288
289 PxU16 numNames1 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId1,keyNames1,5,inputMask);
290
291 const char* keyNames2[5];
292 PxU16 numNames2 = getPlatform()->getSampleUserInput()->getUserInputKeys(inputEventId2,keyNames2,5,inputMask);
293
294 if(!numNames1 && !numNames2)
295 return NULL;
296
297 strcpy(m_Msg, firstPart);
298 if(numNames1 && numNames2)
299 {
300 for (PxU16 i = 0; i < numNames1; i++)
301 {
302 strcat(m_Msg, keyNames1[i]);
303 strcat(m_Msg, " or ");
304 }
305
306 for (PxU16 i = 0; i < numNames2; i++)
307 {
308 strcat(m_Msg, keyNames2[i]);
309 if(i != numNames2 - 1)
310 strcat(m_Msg, " or ");
311 }
312 }
313 else
314 {
315 if(numNames1)
316 {
317 for (PxU16 i = 0; i < numNames1; i++)
318 {
319 strcat(m_Msg, keyNames1[i]);
320 if(i != numNames1 - 1)
321 strcat(m_Msg, " or ");
322 }
323 }
324 else

Callers 8

helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80
helpRenderMethod · 0.80

Calls 4

getSampleUserInputMethod · 0.80
getUserInputKeysMethod · 0.80
gamepadSupportedMethod · 0.45
keyboardSupportedMethod · 0.45

Tested by

no test coverage detected