diff --git a/src/graphic/Fast3D/gfx_direct3d11.cpp b/src/graphic/Fast3D/gfx_direct3d11.cpp index 4f987fe06..4b69ef2ea 100644 --- a/src/graphic/Fast3D/gfx_direct3d11.cpp +++ b/src/graphic/Fast3D/gfx_direct3d11.cpp @@ -1229,7 +1229,7 @@ gfx_d3d11_get_pixel_depth(int fb_id, const std::set>& co } // namespace -ImTextureID gfx_d3d11_get_texture_by_id(int id) { +ImTextureID gfx_d3d11_get_texture_by_id(unsigned long long id) { return d3d.textures[id].resource_view.Get(); } diff --git a/src/graphic/Fast3D/gfx_direct3d11.h b/src/graphic/Fast3D/gfx_direct3d11.h index d1eea89f4..68022bc1d 100644 --- a/src/graphic/Fast3D/gfx_direct3d11.h +++ b/src/graphic/Fast3D/gfx_direct3d11.h @@ -10,7 +10,7 @@ #include extern struct GfxRenderingAPI gfx_direct3d11_api; -ImTextureID gfx_d3d11_get_texture_by_id(int id); +ImTextureID gfx_d3d11_get_texture_by_id(unsigned long long id); #endif diff --git a/src/graphic/Fast3D/gfx_metal.cpp b/src/graphic/Fast3D/gfx_metal.cpp index d8c972a70..28820146c 100644 --- a/src/graphic/Fast3D/gfx_metal.cpp +++ b/src/graphic/Fast3D/gfx_metal.cpp @@ -1295,7 +1295,7 @@ FilteringMode gfx_metal_get_texture_filter() { return mctx.current_filter_mode; } -ImTextureID gfx_metal_get_texture_by_id(int fb_id) { +ImTextureID gfx_metal_get_texture_by_id(unsigned long long fb_id) { return (void*)mctx.textures[fb_id].texture; } diff --git a/src/graphic/Fast3D/gfx_metal.h b/src/graphic/Fast3D/gfx_metal.h index c014b234e..e3ff0f48c 100644 --- a/src/graphic/Fast3D/gfx_metal.h +++ b/src/graphic/Fast3D/gfx_metal.h @@ -15,7 +15,7 @@ extern struct GfxRenderingAPI gfx_metal_api; -ImTextureID gfx_metal_get_texture_by_id(int id); +ImTextureID gfx_metal_get_texture_by_id(unsigned long long id); bool Metal_IsSupported(); diff --git a/src/window/gui/Gui.cpp b/src/window/gui/Gui.cpp index d89a6b074..0b70f9c07 100644 --- a/src/window/gui/Gui.cpp +++ b/src/window/gui/Gui.cpp @@ -654,7 +654,7 @@ void Gui::DrawGame() { } if (gfxFramebuffer) { ImGui::SetCursorPos(pos); - ImGui::Image((ImTextureID)gfxFramebuffer, size); + ImGui::Image(gfxFramebuffer, size); } ImGui::End(); @@ -722,7 +722,7 @@ void Gui::SetupRendererFrame() { } } -ImTextureID Gui::GetTextureById(int32_t id) { +ImTextureID Gui::GetTextureById(unsigned long long id) { #ifdef ENABLE_DX11 if (Context::GetInstance()->GetWindow()->GetWindowBackend() == WindowBackend::FAST3D_DXGI_DX11) { return gfx_d3d11_get_texture_by_id(id); @@ -734,7 +734,7 @@ ImTextureID Gui::GetTextureById(int32_t id) { } #endif - return (ImTextureID)id; + return id; } bool Gui::HasTextureByName(const std::string& name) { @@ -743,7 +743,7 @@ bool Gui::HasTextureByName(const std::string& name) { ImTextureID Gui::GetTextureByName(const std::string& name) { if (!Gui::HasTextureByName(name)) { - return (ImTextureID)nullptr; + return 0; } return GetTextureById(mGuiTextures[name].RendererTextureId); } diff --git a/src/window/gui/Gui.h b/src/window/gui/Gui.h index 10d09c865..1b1c2da29 100644 --- a/src/window/gui/Gui.h +++ b/src/window/gui/Gui.h @@ -119,7 +119,7 @@ class Gui { void ImGuiBackendInit(); void ImGuiRenderDrawData(ImDrawData* data); - ImTextureID GetTextureById(int32_t id); + ImTextureID GetTextureById(unsigned long long id); void ApplyResolutionChanges(); int16_t GetIntegerScaleFactor(); void CheckSaveCvars(); diff --git a/src/window/gui/resource/GuiTexture.h b/src/window/gui/resource/GuiTexture.h index a5145a62e..05532fb75 100644 --- a/src/window/gui/resource/GuiTexture.h +++ b/src/window/gui/resource/GuiTexture.h @@ -7,7 +7,7 @@ namespace Ship { #define RESOURCE_TYPE_GUI_TEXTURE 0x47544558 // GTEX struct GuiTextureMetadata { - uint32_t RendererTextureId; + unsigned long long RendererTextureId; int32_t Width; int32_t Height; };