@ -334,6 +334,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- optimization: replace vsnprintf with stb_printf? or enable the defines/infrastructure to allow it (#1038)
- optimization: add clipping for multi-component widgets (SliderFloatX, ColorEditX, etc.). one problem is that nav branch can't easily clip parent group when there is a move request.
- optimization: add a flag to disable most of rendering, for the case where the user expect to skip it (#335)
- optimization: fully covered window (covered by another with non-translucent bg + WindowRounding worth of padding) may want to clip rendering.
- optimization: use another hash function than crc32, e.g. FNV1a
- optimization/render: merge command-lists with same clip-rect into one even if they aren't sequential? (as long as in-between clip rectangle don't overlap)?
- optimization: turn some the various stack vectors into statically-sized arrays
// FIXME-OPT: Need a way to reuse the result of lower_bound when doing GetInt()/SetInt() - not too bad because it only happens on explicit interaction (maximum one a frame)
// Lightweight std::vector<>-like class to avoid dragging dependencies (also: some implementations of STL with debug enabled are absurdly slow, we bypass it so our code runs fast in debug).
// Lightweight std::vector<>-like class to avoid dragging dependencies (also, some implementations of STL with debug enabled are absurdly slow, we bypass it so our code runs fast in debug).
// You generally do NOT need to care or use this ever. But we need to make it available in imgui.h because some of our data structures are relying on it.
// Important: clear() frees memory, resize(0) keep the allocated buffer. We use resize(0) a lot to intentionally recycle allocated buffers across frames and amortize our costs.
// Important: our implementation does NOT call C++ constructors/destructors, we treat everything as raw data! This is intentional but be extra mindful of that,
// do NOT use this class as a std::vector replacement in your own code!
// do NOT use this class as a std::vector replacement in your own code! Many of the structures used by dear imgui can be safely initialized by a zero-memset.
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
inlinevoidPathFillConvex(ImU32col){AddConvexPolyFilled(_Path.Data,_Path.Size,col);PathClear();}// Note: Anti-aliased filling requires points to be in clockwise order.
inlinevoidPathFillConvex(ImU32col){AddConvexPolyFilled(_Path.Data,_Path.Size,col);_Path.Size=0;}// Note: Anti-aliased filling requires points to be in clockwise order.
boolGetBit(intn)const{intoff=(n>>5);intmask=1<<(n&31);return(UsedChars[off]&mask)!=0;}// Get bit n in the array
voidSetBit(intn){intoff=(n>>5);intmask=1<<(n&31);UsedChars[off]|=mask;}// Set bit n in the array
voidAddChar(ImWcharc){SetBit(c);}// Add character
IMGUI_APIvoidAddText(constchar*text,constchar*text_end=NULL);// Add string (each character of the UTF-8 string are added)
IMGUI_APIvoidAddRanges(constImWchar*ranges);// Add ranges, e.g. builder.AddRanges(ImFontAtlas::GetGlyphRangesDefault()) to force add all of ASCII/Latin+Ext
// To implement maths operators for ImVec2 (disabled by default to not collide with using IM_VEC2_CLASS_EXTRA along with your own math types+operators)