MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / keyboard

Function keyboard

cpp/0_Introduction/simpleCUDA2GL/main.cpp:390–411  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Keyboard events handler ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

388//! Keyboard events handler
389////////////////////////////////////////////////////////////////////////////////
390void keyboard(unsigned char key, int /*x*/, int /*y*/)
391{
392 switch (key) {
393 case (27):
394 Cleanup(EXIT_SUCCESS);
395 break;
396
397 case ' ':
398 enable_cuda ^= 1;
399#ifdef USE_TEXTURE_RGBA8UI
400
401 if (enable_cuda) {
402 glClearColorIuiEXT(128, 128, 128, 255);
403 }
404 else {
405 glClearColor(0.5, 0.5, 0.5, 1.0);
406 }
407
408#endif
409 break;
410 }
411}
412
413void reshape(int w, int h)
414{

Callers 1

mainMenuFunction · 0.70

Calls 1

CleanupFunction · 0.70

Tested by

no test coverage detected