Update DebugActor
This commit is contained in:
parent
9329b6f888
commit
4633d7b6b9
|
|
@ -78,17 +78,17 @@ void DebugActor::OnRender(RenderContext& ctx)
|
||||||
ctx.SetCurrentBrush(background_brush_);
|
ctx.SetCurrentBrush(background_brush_);
|
||||||
ctx.FillRoundedRectangle(GetBounds(), Vec2{ 5.f, 5.f });
|
ctx.FillRoundedRectangle(GetBounds(), Vec2{ 5.f, 5.f });
|
||||||
ctx.DrawTextLayout(debug_text_, Point(10, 10));
|
ctx.DrawTextLayout(debug_text_, Point(10, 10));
|
||||||
}
|
|
||||||
|
|
||||||
void DebugActor::OnUpdate(Duration dt)
|
|
||||||
{
|
|
||||||
KGE_NOT_USED(dt);
|
|
||||||
|
|
||||||
frame_time_.push_back(Time::Now());
|
frame_time_.push_back(Time::Now());
|
||||||
while (frame_time_.back() - frame_time_.front() >= Duration::Second)
|
while (frame_time_.back() - frame_time_.front() >= Duration::Second)
|
||||||
{
|
{
|
||||||
frame_time_.erase(frame_time_.begin());
|
frame_time_.erase(frame_time_.begin());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DebugActor::OnUpdate(Duration dt)
|
||||||
|
{
|
||||||
|
KGE_NOT_USED(dt);
|
||||||
|
|
||||||
StringStream ss;
|
StringStream ss;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,10 @@ protected:
|
||||||
bool CheckVisibility(RenderContext& ctx) const override;
|
bool CheckVisibility(RenderContext& ctx) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::locale comma_locale_;
|
std::locale comma_locale_;
|
||||||
BrushPtr background_brush_;
|
BrushPtr background_brush_;
|
||||||
TextLayout debug_text_;
|
TextLayout debug_text_;
|
||||||
Vector<Time> frame_time_;
|
List<Time> frame_time_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue