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

Function keyboard

cpp/0_Introduction/simpleTexture3D/simpleTexture3D.cpp:183–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void keyboard(unsigned char key, int x, int y)
184{
185 switch (key) {
186 case 27:
187#if defined(__APPLE__) || defined(MACOSX)
188 exit(EXIT_SUCCESS);
189 glutDestroyWindow(glutGetWindow());
190 return;
191#else
192 glutDestroyWindow(glutGetWindow());
193 return;
194#endif
195
196 case '=':
197 case '+':
198 w += 0.01f;
199 break;
200
201 case '-':
202 w -= 0.01f;
203 break;
204
205 case 'f':
206 linearFiltering = !linearFiltering;
207 setTextureFilterMode(linearFiltering);
208 break;
209
210 case ' ':
211 animate = !animate;
212 break;
213
214 default:
215 break;
216 }
217
218 glutPostRedisplay();
219}
220
221void reshape(int x, int y)
222{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected