| 386 | void glutClose() { cleanup(EXIT_SUCCESS); } |
| 387 | |
| 388 | void keyboard(unsigned char key, int x, int y) |
| 389 | { |
| 390 | switch (key) { |
| 391 | // Select shape |
| 392 | case 's': |
| 393 | case 'S': |
| 394 | g_currentShape = Sphere; |
| 395 | createSphere(); |
| 396 | display(); |
| 397 | break; |
| 398 | |
| 399 | case 'e': |
| 400 | case 'E': |
| 401 | g_currentShape = SphericalShell; |
| 402 | createSphere(); |
| 403 | display(); |
| 404 | break; |
| 405 | |
| 406 | case 'b': |
| 407 | case 'B': |
| 408 | g_currentShape = Cube; |
| 409 | createCube(); |
| 410 | display(); |
| 411 | break; |
| 412 | |
| 413 | case 'p': |
| 414 | case 'P': |
| 415 | g_currentShape = Plane; |
| 416 | createPlane(); |
| 417 | display(); |
| 418 | break; |
| 419 | |
| 420 | // Rotation |
| 421 | case 'a': |
| 422 | case 'A': |
| 423 | g_bAutoRotate = !g_bAutoRotate; |
| 424 | break; |
| 425 | |
| 426 | case 'i': |
| 427 | case 'I': |
| 428 | g_xRotated -= 1.0f; |
| 429 | |
| 430 | if (g_xRotated <= 0.0f) { |
| 431 | g_xRotated += 360.0f; |
| 432 | } |
| 433 | |
| 434 | display(); |
| 435 | break; |
| 436 | |
| 437 | case ',': |
| 438 | g_xRotated += 1.0f; |
| 439 | |
| 440 | if (g_xRotated >= 360.0f) { |
| 441 | g_xRotated -= 360.0f; |
| 442 | } |
| 443 | |
| 444 | display(); |
| 445 | break; |
nothing calls this directly
no test coverage detected