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

Method Console

physx/samples/samplebase/SampleConsole.cpp:120–159  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * Constructor. */ //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

118 */
119///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
120Console::Console(SampleFramework::SamplePlatform* plt) :
121 mViewBottom (0),
122 mNewline (0),
123 mIsActive (false)
124{
125 strcpy(mLastChar, "-");
126 strcpy(mPrompt, ">");
127 resetCol();
128
129 mNbCmds = 0;
130 mNewcmd = 0;
131 mNumcmdhist = 0;
132 mCurcmd = 0;
133 mUserData = 0;
134
135 for(PxU32 i=0;i<CONSOLE_MAX_COMMAND_NB;i++)
136 mCmds[i] = NULL;
137
138 // Create console
139 addCmd("exit", BasicCmdexit);
140 addCmd("cmdlist", BasicCmdcmdlist);
141 addCmd("cls", BasicCmdcls);
142 addCmd("cmdhist", BasicCmdcmdhist);
143 addCmd("prompt", BasicCmdSetPrompt);
144
145 clear();
146 cmdClear();
147
148 out("PhysX Samples console");
149 out("");
150 out("Type cmdlist to display all possible commands.");
151 out("Use PageUp / PageDown to scroll the window.");
152 out("Use arrow keys to recall old commands.");
153 out("Use ESC to exit.");
154 out("");
155
156 advance();
157 strcpy(mBuffer[mNewline].mText, mPrompt);
158 strcat(mBuffer[mNewline].mText, mLastChar);
159}
160
161///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
162/**

Callers

nothing calls this directly

Calls 2

advanceFunction · 0.85
clearFunction · 0.50

Tested by

no test coverage detected