• Martin Heistermann's avatar
    Bugfix: Colored edge rendering in core profile, fixes OpenFlipper-Free#167 . · 551932af
    Martin Heistermann authored
    This is a minimally invasive change, leaving the old code intact, as it
    is shared with the other renderers.
    Instead of creating render objects as it should, the previous
    implementation called glDraw itself and used host-memory ("sysmem")
    buffers for it, which are not supported in core OpenGL.
    In the new implementation, edge coordinates and colors are uploaded to
    a common VBO and rendered using proper render objects.
    Having two VBOs for coordinates and colors respectively is advantageous
    for better performance when rendering non-colored edges and could be
    achieved by packing both in a VAO, which this implementation does not
    yet do. However it's better to have something working than to have something
    more efficient but broken.
    NB Colored edge rendering in classic renderer was also(!) broken before and
    is not fixed by this commit, crashes can be provoked by setting edge
    colors, switching the drawmode to colored edges and emitting an
    updatedObject with the UPDATE_COLORS flag.
    I have not run any tests, but I suspect the colored halfedge drawmode to
    be similarly broken. A big refactoring / rewrite might be a good idea.
DrawMeshT_impl.hh 78.7 KB