1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[hud] Implement client API info as a HUD item

This commit is contained in:
Philip Rebohle 2019-12-12 21:06:48 +01:00
parent 1c079a96e5
commit e4bc5c2aee
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 49 additions and 8 deletions

View File

@ -35,6 +35,7 @@ namespace dxvk::hud {
| VK_COLOR_COMPONENT_A_BIT;
addItem<HudVersionItem>("version");
addItem<HudClientApiItem>("api", m_device);
}
@ -90,14 +91,6 @@ namespace dxvk::hud {
HudPos position = { 8.0f, 24.0f };
if (m_config.elements.test(HudElement::DxvkClientApi)) {
m_renderer.drawText(16.0f,
{ position.x, position.y },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_device->clientApi());
position.y += 24.0f;
}
if (m_config.elements.test(HudElement::DeviceInfo))
position = m_hudDeviceInfo.render(m_renderer, position);

View File

@ -75,4 +75,30 @@ namespace dxvk::hud {
return position;
}
HudClientApiItem::HudClientApiItem(const Rc<DxvkDevice>& device)
: m_device(device) {
}
HudClientApiItem::~HudClientApiItem() {
}
HudPos HudClientApiItem::render(
HudRenderer& renderer,
HudPos position) {
position.y += 16.0f;
renderer.drawText(16.0f,
{ position.x, position.y },
{ 1.0f, 1.0f, 1.0f, 1.0f },
m_device->clientApi());
position.y += 8.0f;
return position;
}
}

View File

@ -114,4 +114,26 @@ namespace dxvk::hud {
};
/**
* \brief HUD item to display the client API
*/
class HudClientApiItem : public HudItem {
public:
HudClientApiItem(const Rc<DxvkDevice>& device);
~HudClientApiItem();
HudPos render(
HudRenderer& renderer,
HudPos position);
private:
Rc<DxvkDevice> m_device;
};
}