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:
parent
0eeedf9259
commit
c1ed8cd1f3
@ -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);
|
||||
|
||||
|
@ -163,6 +163,8 @@ namespace dxvk::hud {
|
||||
|
||||
~HudClientApiItem();
|
||||
|
||||
void setApiName(std::string api);
|
||||
|
||||
HudPos render(
|
||||
const DxvkContextObjects& ctx,
|
||||
const HudPipelineKey& key,
|
||||
@ -172,6 +174,7 @@ namespace dxvk::hud {
|
||||
|
||||
private:
|
||||
|
||||
sync::Spinlock m_mutex;
|
||||
std::string m_api;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user