| 29 | } |
| 30 | |
| 31 | void CUICursor::OnRender() |
| 32 | { |
| 33 | static u32 last_frame{}; |
| 34 | if (last_frame == Device.dwFrame) |
| 35 | return; |
| 36 | last_frame = Device.dwFrame; |
| 37 | |
| 38 | if (!IsVisible()) |
| 39 | return; |
| 40 | |
| 41 | #ifdef DEBUG |
| 42 | static u32 last_render_frame = 0; |
| 43 | VERIFY(last_render_frame != Device.dwFrame); |
| 44 | last_render_frame = Device.dwFrame; |
| 45 | |
| 46 | if (bDebug) |
| 47 | { |
| 48 | CGameFont* F = UI()->Font()->pFontDI; |
| 49 | F->SetAligment(CGameFont::alCenter); |
| 50 | F->SetHeightI(0.02f); |
| 51 | F->OutSetI(0.f, -0.9f); |
| 52 | F->SetColor(0xffffffff); |
| 53 | Fvector2 pt = GetCursorPosition(); |
| 54 | F->OutNext("%f-%f", pt.x, pt.y); |
| 55 | } |
| 56 | #endif |
| 57 | |
| 58 | m_static->SetWndPos(vPos); |
| 59 | m_static->Update(); |
| 60 | m_static->Draw(); |
| 61 | } |
| 62 | |
| 63 | Fvector2 CUICursor::GetCursorPosition() const { return vPos; } |
| 64 | |