From 337e476fb81e620b16aebaaa3c76be88ec759786 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 17 May 2022 16:29:35 -0600 Subject: [PATCH] Support SFML 3 API --- imgui-SFML.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index bbea0ef..9711079 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -784,9 +784,15 @@ bool UpdateFontTexture() { io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); sf::Texture& texture = s_currWindowCtx->fontTexture; +#if SFML_VERSION_MAJOR >= 3 + if (!texture.create(sf::Vector2u(width, height))) { + return false; + } +#else if (!texture.create(width, height)) { return false; } +#endif texture.update(pixels);