Skip to content

A suggestion related to enhancing compatibility #982

@Ricepies

Description

@Ricepies

in view.cpp ~300th line
maybe replace with the following code

    const int zsize = zl*zl;
    // GLfloat zs[zsize];
    std::vector<GLfloat> zs(zsize);

#ifndef HAVE_GLES
    glReadBuffer(GL_FRONT);
    // glReadPixels(x-radius,y-radius,zl,zl,GL_DEPTH_COMPONENT,GL_FLOAT,zs);
    glReadPixels(x - radius, y - radius, zl, zl, GL_DEPTH_COMPONENT, GL_FLOAT, zs.data());
#else
    std::fill(zs,zs+zsize, 0.8);
#endif

    //const GLfloat mindepth = *(std::min_element(zs,zs+zsize));
    const GLfloat mindepth = *std::min_element(zs.begin(), zs.end());
    return mindepth;
}

to prevent issues related to variable sized arrays when compiling with clan on MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions