MCPcopy Create free account
hub / github.com/RenderKit/embree / waitForKeyPressedUnderWindows

Function waitForKeyPressedUnderWindows

tutorials/minimal/minimal.cpp:201–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void waitForKeyPressedUnderWindows()
202{
203#if defined(_WIN32)
204 HANDLE hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
205
206 CONSOLE_SCREEN_BUFFER_INFO csbi;
207 if (!GetConsoleScreenBufferInfo(hStdOutput, &csbi)) {
208 printf("GetConsoleScreenBufferInfo failed: %lu\n", GetLastError());
209 return;
210 }
211
212 /* do not pause when running on a shell */
213 if (csbi.dwCursorPosition.X != 0 || csbi.dwCursorPosition.Y != 0)
214 return;
215
216 /* only pause if running in separate console window. */
217 printf("\n\tPress any key to exit...\n");
218 _getch();
219#endif
220}
221
222
223/* -------------------------------------------------------------------------- */

Callers 4

mainFunction · 0.70
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected