mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 00:04:35 +00:00
Add fast line drawing function.
This skips unnecessary construction of ImVec2 vector. Note: unlike AddLine(), this function doesn't add 0.5 to x and y coordinates. The user is expected to do it on his own, which if done in just one place will be performance beneficial.
This commit is contained in:
parent
b9ce9540be
commit
fe22d5a6f6
@ -12,6 +12,7 @@
|
||||
#include "../imgui/imgui.h"
|
||||
#include "../imgui/imgui_internal.h"
|
||||
|
||||
#include "../common/TracyForceInline.hpp"
|
||||
#include "IconsFontAwesome5.h"
|
||||
|
||||
#if !IMGUI_DEFINE_MATH_OPERATORS
|
||||
@ -238,6 +239,12 @@ static const ImVec4 SyntaxColorsDimmed[] = {
|
||||
ImGui::PopClipRect();
|
||||
}
|
||||
|
||||
[[maybe_unused]] static tracy_force_inline void DrawLine( ImDrawList* draw, const ImVec2& v1, const ImVec2& v2, uint32_t col, float thickness = 1.0f )
|
||||
{
|
||||
const ImVec2 data[2] = { v1, v2 };
|
||||
draw->AddPolyline( data, 2, col, 0, thickness );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user