Segfault after mjr_maxViewport(&con)

Discussion in 'Visualization' started by bhairavm, May 8, 2018.

  1. Code:
        mjvScene scn = state->scn;
        mjrContext con = state->con;
        mjr_setBuffer(mjFB_OFFSCREEN, &con);
        mjrRect viewport = mjr_maxViewport(&con);
        mjr_render(viewport, &scn, &con);
        mjr_readPixels(rgb, NULL, viewport, &con);
    I run this piece of custom code in a loop. While the first time the image renders, on the second iteration, the code segfaults at mjr_render. Am I using these functions incorrectly?