MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / draw_rect

Function draw_rect

ogsr_engine/xrGame/ui/UIWindow.cpp:41–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39static void add_rect_to_draw(const Frect& r, const shared_str& windowName) { g_wnds_rects.emplace_back(windowName, r); }
40
41static void draw_rect(const Frect& r, const u32 color, const shared_str& name)
42{
43 DRender->SetDebugShader(IDebugRender::dbgShaderWindow);
44
45 //. UIRender->StartLineStrip (5);
46 UIRender->StartPrimitive(5, IUIRender::ptLineStrip, UI()->m_currentPointType);
47
48 UIRender->PushPoint(r.lt.x, r.lt.y, 0, color, 0, 0);
49 UIRender->PushPoint(r.rb.x - 1, r.lt.y, 0, color, 0, 0);
50 UIRender->PushPoint(r.rb.x - 1, r.rb.y - 1, 0, color, 0, 0);
51 UIRender->PushPoint(r.lt.x, r.rb.y - 1, 0, color, 0, 0);
52 UIRender->PushPoint(r.lt.x, r.lt.y, 0, color, 0, 0);
53
54 //. UIRender->FlushLineStrip();
55 UIRender->FlushPrimitive();
56
57 if (g_show_wnd_rect_text && name.size())
58 {
59 CGameFont* F = UI()->Font()->pFontDI;
60 const float x = r.lt.x - (r.lt.x >= 20 ? 20 : 0);
61 const float y = r.lt.y > Device.dwHeight / 2 ? r.lt.y - F->CurrentHeight_() - 20 : r.rb.y + 20;
62 F->Out(x, y, name.c_str());
63 F->SetColor(D3DCOLOR_XRGB(255, 0, 255));
64 }
65}
66
67void draw_wnds_rects()
68{

Callers 1

draw_wnds_rectsFunction · 0.85

Calls 11

UIFunction · 0.85
SetDebugShaderMethod · 0.80
StartPrimitiveMethod · 0.80
PushPointMethod · 0.80
FlushPrimitiveMethod · 0.80
FontMethod · 0.80
CurrentHeight_Method · 0.80
sizeMethod · 0.45
OutMethod · 0.45
c_strMethod · 0.45
SetColorMethod · 0.45

Tested by

no test coverage detected