| 319 | } |
| 320 | |
| 321 | void ImDrawList::ClearFreeMemory() |
| 322 | { |
| 323 | CmdBuffer.clear(); |
| 324 | IdxBuffer.clear(); |
| 325 | VtxBuffer.clear(); |
| 326 | _VtxCurrentIdx = 0; |
| 327 | _VtxWritePtr = NULL; |
| 328 | _IdxWritePtr = NULL; |
| 329 | _ClipRectStack.clear(); |
| 330 | _TextureIdStack.clear(); |
| 331 | _Path.clear(); |
| 332 | _ChannelsCurrent = 0; |
| 333 | _ChannelsCount = 1; |
| 334 | for (int i = 0; i < _Channels.Size; i++) |
| 335 | { |
| 336 | if (i == 0) memset(&_Channels[0], 0, sizeof(_Channels[0])); // channel 0 is a copy of CmdBuffer/IdxBuffer, don't destruct again |
| 337 | _Channels[i].CmdBuffer.clear(); |
| 338 | _Channels[i].IdxBuffer.clear(); |
| 339 | } |
| 340 | _Channels.clear(); |
| 341 | } |
| 342 | |
| 343 | // Using macros because C++ is a terrible language, we want guaranteed inline, no code in header, and no overhead in Debug builds |
| 344 | #define GetCurrentClipRect() (_ClipRectStack.Size ? _ClipRectStack.Data[_ClipRectStack.Size-1] : _Data->ClipRectFullscreen) |