diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3abd85..e7d1397 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,6 @@ jobs: cmake -S imgui-sfml -B imgui-sfml/build \ -DCMAKE_BUILD_TYPE=${{matrix.type.name}} \ -DCMAKE_CXX_EXTENSIONS=OFF \ - -DCMAKE_CXX_STANDARD=11 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install \ -DCMAKE_VERBOSE_MAKEFILE=ON \ diff --git a/.gitignore b/.gitignore index fcb6a2f..9641c80 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build +CMakeUserPresets.json diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index 3c5bd92..d25c264 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -507,16 +507,14 @@ bool UpdateFontTexture() { io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); - auto newTexture = - sf::Texture::create({static_cast(width), static_cast(height)}); - - if (!newTexture.has_value()) { + sf::Texture newTexture; + if (!newTexture.resize({static_cast(width), static_cast(height)})) { return false; } - newTexture->update(pixels); + newTexture.update(pixels); - ImTextureID texID = convertGLTextureHandleToImTextureID(newTexture->getNativeHandle()); + ImTextureID texID = convertGLTextureHandleToImTextureID(newTexture.getNativeHandle()); io.Fonts->SetTexID(texID); s_currWindowCtx->fontTexture = std::move(newTexture); @@ -1074,7 +1072,7 @@ const char* getClipboardText(void* /*userData*/) { } void loadMouseCursor(ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType) { - s_currWindowCtx->mouseCursors[imguiCursorType] = sf::Cursor::loadFromSystem(sfmlCursorType); + s_currWindowCtx->mouseCursors[imguiCursorType] = sf::Cursor::createFromSystem(sfmlCursorType); } void updateMouseCursor(sf::Window& window) {