1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 04:29:15 +01:00

[hud] Add function to change API name dynamically

Needed for D3D8 due to implicit swapchain shenanigans.
This commit is contained in:
Philip Rebohle 2025-01-13 11:32:12 +01:00 committed by Philip Rebohle
parent 0eeedf9259
commit c1ed8cd1f3
2 changed files with 13 additions and 2 deletions

View File

@ -112,7 +112,7 @@ namespace dxvk::hud {
HudClientApiItem::HudClientApiItem(std::string api)
: m_api(api) {
: m_api(std::move(api)) {
}
@ -122,12 +122,20 @@ namespace dxvk::hud {
}
void HudClientApiItem::setApiName(std::string api) {
std::lock_guard lock(m_mutex);
m_api = std::move(api);
}
HudPos HudClientApiItem::render(
const DxvkContextObjects& ctx,
const HudPipelineKey& key,
const HudOptions& options,
HudRenderer& renderer,
HudPos position) {
std::lock_guard lock(m_mutex);
position.y += 16;
renderer.drawText(16, position, 0xffffffffu, m_api);

View File

@ -163,6 +163,8 @@ namespace dxvk::hud {
~HudClientApiItem();
void setApiName(std::string api);
HudPos render(
const DxvkContextObjects& ctx,
const HudPipelineKey& key,
@ -172,7 +174,8 @@ namespace dxvk::hud {
private:
std::string m_api;
sync::Spinlock m_mutex;
std::string m_api;
};