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:
parent
1c079a96e5
commit
e4bc5c2aee
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user