openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
update method for drawing slider bars (#6297)
* update method for drawing slider bars Instead of calling ofPath tessellation on each draw call for sliders, slider knows how to generate mesh for bar rectangles itself. The mesh is cached, and only updated iff the slider value changes. Rect mesh caching works similarly to the slider's internal caching of text meshes. You might notice a slight perfomance improvement on GUIs with multiple sliders with this PR. As an additional check/optimisation, slider fill rectangles with either width or height < 1 pixels will also not be drawn (they would not be visible anyway). By *not* using ofPath (and by implication the tessellator) to draw the slider we avoid having to ask the tessellator to tessellate extremely small paths, in which case it had a tendency to throw its hands up in despair or disgust (hard to tell from a stack trace) and cause crashes (see issue #6294). #changelog #addons #ofxGui
T
Tim Gfrerer committed
35ff092d643948c204600c112061fc215f0fa0e0
Parent: 860f265
Committed by arturo <arturo@openframeworks.cc>
on 5/23/2019, 1:48:00 PM