MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / initializeVisualization

Function initializeVisualization

src/openpose/gui/gui3D.cpp:381–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379 }
380
381 void initializeVisualization()
382 {
383 try
384 {
385 char *my_argv[] = { NULL };
386 int my_argc = 0;
387 glutInit(&my_argc, my_argv);
388 // Setup the size, position, and display mode for new windows
389 glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT);
390 glutInitWindowPosition(200, 0);
391 // glutSetOption(GLUT_MULTISAMPLE,8);
392 // Ideally adding also GLUT_BORDERLESS | GLUT_CAPTIONLESS should fix the problem of disabling the `x`
393 // button, but it does not work (tested in Ubuntu)
394 // https://stackoverflow.com/questions/3799803/is-it-possible-to-make-a-window-withouth-a-top-in-glut
395 glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE);
396 // Create and set up a window
397 glutCreateWindow(std::string{OPEN_POSE_NAME_AND_VERSION + " - 3-D Display"}.c_str());
398 initGraphics();
399 glutDisplayFunc(renderMain);
400 glutMouseFunc(mouseButton);
401 glutMotionFunc(mouseMotion);
402 // Only required if glutMainLoop() called
403 // glutIdleFunc(idleFunction);
404 // Full screen would fix the problem of disabling `x` button
405 // glutFullScreen();
406 // Key presses
407 glutKeyboardFunc(keyPressed);
408 }
409 catch (const std::exception& e)
410 {
411 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
412 }
413 }
414 #else
415 const std::string USE_3D_RENDERER_ERROR{"OpenPose CMake must be compiled with the `USE_3D_RENDERER` flag in"
416 " order to use the 3-D visualization renderer. Alternatively, set 2-D rendering with `--display 2`."};

Callers 1

Calls 3

initGraphicsFunction · 0.85
whatMethod · 0.80
errorFunction · 0.50

Tested by

no test coverage detected