Reserve enough space for each line in profiler
And use drawQuick to avoid text shaping
This commit is contained in:
parent
13b6a6b25c
commit
b58b93ac98
@ -42,8 +42,8 @@ Profiler profiler;
|
|||||||
#define MARGIN_Y 0.02f // top margin
|
#define MARGIN_Y 0.02f // top margin
|
||||||
#define LINE_HEIGHT 0.030f // height of a line representing a thread
|
#define LINE_HEIGHT 0.030f // height of a line representing a thread
|
||||||
|
|
||||||
#define MARKERS_NAMES_POS core::rect<s32>(50,100,150,200)
|
#define MARKERS_NAMES_POS core::rect<s32>(50,100,150,600)
|
||||||
#define GPU_MARKERS_NAMES_POS core::rect<s32>(50,165,150,250)
|
#define GPU_MARKERS_NAMES_POS core::rect<s32>(50,165,150,300)
|
||||||
|
|
||||||
// The width of the profiler corresponds to TIME_DRAWN_MS milliseconds
|
// The width of the profiler corresponds to TIME_DRAWN_MS milliseconds
|
||||||
#define TIME_DRAWN_MS 30.0f
|
#define TIME_DRAWN_MS 30.0f
|
||||||
@ -463,14 +463,14 @@ void Profiler::draw()
|
|||||||
text += oss.str().c_str();
|
text += oss.str().c_str();
|
||||||
hovered_markers.pop();
|
hovered_markers.pop();
|
||||||
}
|
}
|
||||||
font->draw(text, MARKERS_NAMES_POS, video::SColor(0xFF, 0xFF, 0x00, 0x00));
|
font->drawQuick(text, MARKERS_NAMES_POS, video::SColor(0xFF, 0xFF, 0x00, 0x00));
|
||||||
|
|
||||||
if (hovered_gpu_marker != Q_LAST)
|
if (hovered_gpu_marker != Q_LAST)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << irr_driver->getGPUQueryPhaseName(hovered_gpu_marker) << " : "
|
oss << irr_driver->getGPUQueryPhaseName(hovered_gpu_marker) << " : "
|
||||||
<< hovered_gpu_marker_elapsed << " us";
|
<< hovered_gpu_marker_elapsed << " us";
|
||||||
font->draw(oss.str().c_str(), GPU_MARKERS_NAMES_POS,
|
font->drawQuick(oss.str().c_str(), GPU_MARKERS_NAMES_POS,
|
||||||
video::SColor(0xFF, 0xFF, 0x00, 0x00));
|
video::SColor(0xFF, 0xFF, 0x00, 0x00));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user