/////////////////////////////////////////////////////////////////////////// Program main ///////////////////////////////////////////////////////////////////////////
| 362 | // Program main |
| 363 | //////////////////////////////////////////////////////////////////////////////// |
| 364 | int main(int argc, char **argv) |
| 365 | { |
| 366 | sdkCreateTimer(&timer); |
| 367 | |
| 368 | pArgc = &argc; |
| 369 | pArgv = argv; |
| 370 | |
| 371 | char *ref_file = NULL; |
| 372 | |
| 373 | #if defined(__linux__) |
| 374 | setenv("DISPLAY", ":0", 0); |
| 375 | #endif |
| 376 | |
| 377 | printf("%s Starting...\n\n", sSDKsample); |
| 378 | |
| 379 | if (checkCmdLineFlag(argc, (const char **)argv, "file")) { |
| 380 | fpsLimit = frameCheckNumber; |
| 381 | getCmdLineArgumentString(argc, (const char **)argv, "file", &ref_file); |
| 382 | } |
| 383 | |
| 384 | srand(15234); |
| 385 | |
| 386 | // use command-line specified CUDA device, otherwise use device with highest |
| 387 | // Gflops/s |
| 388 | findCudaDevice(argc, (const char **)argv); |
| 389 | |
| 390 | if (!ref_file) { |
| 391 | initGL(&argc, argv); |
| 392 | |
| 393 | // OpenGL buffers |
| 394 | initGLBuffers(); |
| 395 | } |
| 396 | |
| 397 | if (!checkCudaCapabilities(3, 0)) { |
| 398 | cleanup(); |
| 399 | |
| 400 | exit(EXIT_WAIVED); |
| 401 | } |
| 402 | |
| 403 | loadImageData(argv[0]); |
| 404 | |
| 405 | if (ref_file) { |
| 406 | runAutoTest(ref_file, argv[0]); |
| 407 | } |
| 408 | |
| 409 | printf("Press space to toggle animation\n" |
| 410 | "Press '+' and '-' to change lod level\n" |
| 411 | "Press 'r' to randomize virtual atlas\n"); |
| 412 | |
| 413 | #if defined(__APPLE__) || defined(MACOSX) |
| 414 | atexit(cleanup_all); |
| 415 | #else |
| 416 | glutCloseFunc(cleanup_all); |
| 417 | #endif |
| 418 | |
| 419 | glutMainLoop(); |
| 420 | } |
nothing calls this directly
no test coverage detected