imgui: update imgui to v1.92.7, update dx9 backend to latest (#605)

This commit is contained in:
bicarus
2026-04-03 01:51:08 -07:00
committed by GitHub
parent 5af3e0d494
commit 1ad6a9412e
17 changed files with 13949 additions and 7546 deletions
+3 -3
View File
@@ -501,7 +501,7 @@ void paint_draw_cmd(
const SwOptions& options,
Stats* stats)
{
const auto texture = reinterpret_cast<const Texture*>(pcmd.TextureId);
const auto texture = reinterpret_cast<const Texture*>(pcmd.GetTexID());
const auto offset = pcmd.IdxOffset;
// ImGui uses the first pixel for "white".
@@ -678,7 +678,7 @@ void bind_imgui_painting()
int font_width, font_height;
io.Fonts->GetTexDataAsAlpha8(&tex_data, &font_width, &font_height);
const auto texture = new Texture{tex_data, font_width, font_height};
io.Fonts->TexID = reinterpret_cast<ImTextureID>(texture);
io.Fonts->SetTexID(reinterpret_cast<ImTextureID>(texture));
}
static Stats s_stats; // TODO: pass as an argument?
@@ -700,7 +700,7 @@ void paint_imgui(uint32_t* pixels, int width_pixels, int height_pixels, const Sw
void unbind_imgui_painting()
{
ImGuiIO& io = ImGui::GetIO();
delete reinterpret_cast<Texture*>(io.Fonts->TexID);
delete reinterpret_cast<Texture*>(io.Fonts->TexID.GetTexID());
io.Fonts = nullptr;
}
+2 -2
View File
@@ -185,7 +185,7 @@ void overlay::SpiceOverlay::init() {
if (UI_SCALE_PERCENT.has_value()) {
const auto scale = static_cast<float>(UI_SCALE_PERCENT.value()) / 100.f;
ImGui::GetStyle().ScaleAllSizes(scale);
ImGui::GetIO().FontGlobalScale = scale;
ImGui::GetStyle().FontScaleMain = scale;
}
// based on CrimsonVesuvius theme from
@@ -283,7 +283,7 @@ void overlay::SpiceOverlay::init() {
io.FontAllowUserScaling = true;
// add default font
io.Fonts->AddFontDefault();
io.Fonts->AddFontDefaultBitmap();
// add fallback fonts for missing glyph ranges
ImFontConfig config {};
+10 -15
View File
@@ -2196,9 +2196,8 @@ namespace overlay::windows {
auto analog_device_changed = ImGui::Combo(
"Device",
&this->analogs_devices_selected,
[](void* data, int i, const char **item) {
*item = ((std::vector<rawinput::Device*>*) data)->at(i)->desc.c_str();
return true;
[](void* data, int i) {
return ((std::vector<rawinput::Device*>*) data)->at(i)->desc.c_str();
},
&this->analogs_devices, (int) this->analogs_devices.size());
@@ -2317,9 +2316,8 @@ namespace overlay::windows {
// controls
ImGui::Combo("Control",
&this->analogs_devices_control_selected,
[](void* data, int i, const char **item) {
*item = ((std::vector<std::string>*) data)->at(i).c_str();
return true;
[](void* data, int i) {
return ((std::vector<std::string>*) data)->at(i).c_str();
},
&control_names, control_names.size());
@@ -2957,9 +2955,8 @@ namespace overlay::windows {
bool control_changed = false;
if (ImGui::Combo("Device",
&this->lights_devices_selected,
[] (void* data, int i, const char **item) {
*item = ((std::vector<rawinput::Device*>*) data)->at(i)->desc.c_str();
return true;
[] (void* data, int i) {
return ((std::vector<rawinput::Device*>*) data)->at(i)->desc.c_str();
},
&this->lights_devices, (int) this->lights_devices.size())) {
this->lights_devices_control_selected = 0;
@@ -3054,9 +3051,8 @@ namespace overlay::windows {
// controls
if (ImGui::Combo("Light Control",
&this->lights_devices_control_selected,
[] (void* data, int i, const char **item) {
*item = ((std::vector<std::string> *) data)->at(i).c_str();
return true;
[] (void* data, int i) {
return ((std::vector<std::string> *) data)->at(i).c_str();
},
&control_names, control_names.size())) {
control_changed = true;
@@ -3137,10 +3133,9 @@ namespace overlay::windows {
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
bool device_changed = ImGui::Combo("##AutoMatchDevice",
&this->auto_match_device_selected,
[] (void* data, int i, const char **item) {
[] (void* data, int i) {
auto *devs = (std::vector<rawinput::Device*>*) data;
*item = devs->at(i)->desc.c_str();
return true;
return devs->at(i)->desc.c_str();
},
&this->auto_match_devices,
(int) this->auto_match_devices.size());