Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2021-05-01 03:34:31 +0300
committerBartosz Taudul <wolf@nereid.pl>2021-05-01 03:57:35 +0300
commitfe22d5a6f652db66f45cacf8fb8ba1ddeac98b44 (patch)
tree0b73635f3357b3adfe353a60985ad306c6d091a1 /server/TracyImGui.hpp
parentb9ce9540be4f5a0910be95eb464298a433eb5e9b (diff)
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.
Diffstat (limited to 'server/TracyImGui.hpp')
-rw-r--r--server/TracyImGui.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/TracyImGui.hpp b/server/TracyImGui.hpp
index 03f7f805..a3b99b49 100644
--- a/server/TracyImGui.hpp
+++ b/server/TracyImGui.hpp
@@ -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