mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Draw text editor with potential source code.
This commit is contained in:
parent
77a875ff6b
commit
facae0b9e1
@ -595,6 +595,7 @@ bool View::DrawImpl()
|
|||||||
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
||||||
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
||||||
if( m_showInfo ) DrawInfo();
|
if( m_showInfo ) DrawInfo();
|
||||||
|
if( m_textEditorFile ) DrawTextEditor();
|
||||||
|
|
||||||
if( m_zoomAnim.active )
|
if( m_zoomAnim.active )
|
||||||
{
|
{
|
||||||
@ -5830,6 +5831,19 @@ void View::DrawInfo()
|
|||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::DrawTextEditor()
|
||||||
|
{
|
||||||
|
bool show = true;
|
||||||
|
ImGui::Begin( "Source view", &show );
|
||||||
|
ImGui::TextColored( ImVec4( 1.f, 0.3f, 0.3f, 1.f ), "/!\\ The source file contents might not reflect the actual profiled code! /!\\" );
|
||||||
|
TextFocused( "File:", m_textEditorFile );
|
||||||
|
if( m_textEditorFont ) ImGui::PushFont( m_textEditorFont );
|
||||||
|
m_textEditor->Render( m_textEditorFile, ImVec2(), true );
|
||||||
|
if( m_textEditorFont ) ImGui::PopFont();
|
||||||
|
ImGui::End();
|
||||||
|
if( !show ) m_textEditorFile = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id )
|
void View::ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -92,6 +92,7 @@ private:
|
|||||||
void DrawCallstackWindow();
|
void DrawCallstackWindow();
|
||||||
void DrawMemoryAllocWindow();
|
void DrawMemoryAllocWindow();
|
||||||
void DrawInfo();
|
void DrawInfo();
|
||||||
|
void DrawTextEditor();
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user