Пример #1
0
static void update_tile_projections(void)
{
    GLint *viewports;
    int i;

    icetGetIntegerv(ICET_NUM_TILES, &num_tiles);
    free(tile_projections);
    tile_projections = malloc(num_tiles*16*sizeof(GLdouble));
    viewports = icetUnsafeStateGet(ICET_TILE_VIEWPORTS);

    for (i = 0; i < num_tiles; i++) {
        icetGetViewportProject(viewports[i*4+0], viewports[i*4+1],
                               viewports[i*4+2], viewports[i*4+3],
                               tile_projections + 16*i);
    }
}
Пример #2
0
static void update_tile_projections(void)
{
    IceTInt num_tiles;
    const IceTInt *viewports;
    IceTDouble *tile_projections;
    IceTInt tile_idx;

    if (  icetStateGetTime(ICET_TILE_VIEWPORTS)
        < icetStateGetTime(ICET_TILE_PROJECTIONS) ) {
        /* Projections already up to date. */
        return;
    }

    icetGetIntegerv(ICET_NUM_TILES, &num_tiles);
    tile_projections = icetStateAllocateDouble(ICET_TILE_PROJECTIONS,
                                               num_tiles*16);
    viewports = icetUnsafeStateGetInteger(ICET_TILE_VIEWPORTS);

    for (tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
        icetGetViewportProject(viewports[tile_idx*4+0], viewports[tile_idx*4+1],
                               viewports[tile_idx*4+2], viewports[tile_idx*4+3],
                               tile_projections + 16*tile_idx);
    }
}