diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index fca999e3..16787d55 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -121,6 +121,9 @@ int main( int argc, char** argv ) continue; } + int display_w, display_h; + glfwGetFramebufferSize(window, &display_w, &display_h); + ImGui_ImplGlfwGL3_NewFrame(); if( !view ) @@ -191,6 +194,7 @@ int main( int argc, char** argv ) else { if( loadThread.joinable() ) loadThread.join(); + view->NotifyRootWindowSize( display_w, display_h ); if( !view->Draw() ) { view.reset(); @@ -257,8 +261,6 @@ int main( int argc, char** argv ) } // Rendering - int display_w, display_h; - glfwGetFramebufferSize(window, &display_w, &display_h); glViewport(0, 0, display_w, display_h); glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w); glClear(GL_COLOR_BUFFER_BIT); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 616f7934..a0090bb4 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -50,6 +50,8 @@ public: static bool Draw(); + void NotifyRootWindowSize( float w, float h ) { m_rootWidth = w; m_rootHeight = h; } + private: enum class Namespace : uint8_t { @@ -240,6 +242,8 @@ private: const char* m_textEditorFile; ImFont* m_textEditorFont; + float m_rootWidth, m_rootHeight; + struct FindZone { enum : uint64_t { Unselected = std::numeric_limits::max() - 1 }; enum class GroupBy : int { Thread, UserText, Callstack };