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

Function keyboard

cpp/5_Domain_Specific/postProcessGL/main.cpp:532–574  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

530//! Keyboard events handler
531////////////////////////////////////////////////////////////////////////////////
532void keyboard(unsigned char key, int /*x*/, int /*y*/)
533{
534 switch (key) {
535 case (27):
536 Cleanup(EXIT_SUCCESS);
537 break;
538
539 case ' ':
540 enable_cuda ^= 1;
541#ifdef USE_TEXTURE_RGBA8UI
542
543 if (enable_cuda) {
544 glClearColorIuiEXT(128, 128, 128, 255);
545 }
546 else {
547 glClearColor(0.5, 0.5, 0.5, 1.0);
548 }
549
550#endif
551 break;
552
553 case 'a':
554 animate ^= 1;
555 break;
556
557 case '=':
558 case '+':
559 if (blur_radius < 16) {
560 blur_radius++;
561 }
562
563 printf("radius = %d\n", blur_radius);
564 break;
565
566 case '-':
567 if (blur_radius > 1) {
568 blur_radius--;
569 }
570
571 printf("radius = %d\n", blur_radius);
572 break;
573 }
574}
575
576void reshape(int w, int h)
577{

Callers 1

mainMenuFunction · 0.70

Calls 1

CleanupFunction · 0.70

Tested by

no test coverage detected