From 2d2e7fa5f499b6365d8318f45f8d01db1c89db0d Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 7 Sep 2023 14:17:44 -0600 Subject: [PATCH 1/6] Disable warnings as errors by default --- .github/workflows/ci.yml | 2 +- cmake/CompilerWarnings.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d360e3c8f..30755fe3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: - name: Configure CMake shell: bash - run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DSFML_BUILD_TEST_SUITE=TRUE ${{matrix.platform.flags}} ${{matrix.config.flags}} + run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install -DSFML_BUILD_EXAMPLES=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DSFML_BUILD_TEST_SUITE=TRUE -DWARNINGS_AS_ERRORS=TRUE ${{matrix.platform.flags}} ${{matrix.config.flags}} - name: Build shell: bash diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index a26cc8f46..96231f8ce 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -4,7 +4,7 @@ # Helper function to enable compiler warnings for a specific set of files function(set_file_warnings) - option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE) + option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" FALSE) set(MSVC_WARNINGS /W4 # Baseline reasonable warnings From 7cd1ce1385a614fb39919776ec38d00bfebd03ef Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 3 Sep 2023 16:41:08 -0600 Subject: [PATCH 2/6] Add changelog for 2.6.1 --- changelog.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/changelog.md b/changelog.md index cd980ae72..1b64ba39b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,36 @@ # Changelog +## SFML 2.6.1 + +Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.6.1 + +### General + +- Stop overwriting CMAKE_MODULE_PATH (#2577) +- Loosen restrictions on unknown compilers (#2585) +- Fix CI deprecation warnings (#2624) +- Fix unused compiler flag error in Clang (#2625) +- Disable warnings as errors by default (#2680) + +### Window + +**Bugfixes** + +- Fix macOS resize event bug (#2618) +- Skip ClientMessage events with other window ID unless it is for IM (#2651) + +### Graphics + +**Bugfixes** + +- Ensure OpenGL extensions are loaded before querying maximum texture size (#2603) + +### Audio + +**Bugfixes** + +- Remove use of C++11 header (#2591) + ## SFML 2.6.0 Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.6.0 From 13c8a1de4e4597e1854fc2a17fef28135660c81e Mon Sep 17 00:00:00 2001 From: Bruno Van de Velde Date: Mon, 9 Oct 2023 22:50:28 +0200 Subject: [PATCH 3/6] Fixed texture being upside down on Android when copying the texture of a RenderTexture --- src/SFML/Graphics/Texture.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 9ba6eeb57..a6648bef7 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -350,6 +350,22 @@ Image Texture::copyToImage() const glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer)); glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, previousFrameBuffer)); + + if (m_pixelsFlipped) + { + // Flip the texture vertically + const int stride = static_cast(m_size.x * 4); + Uint8* currentRowPtr = pixels.data(); + Uint8* nextRowPtr = pixels.data() + stride; + Uint8* reverseRowPtr = pixels.data() + (stride * static_cast(m_size.y - 1)); + for (unsigned int y = 0; y < m_size.y / 2; ++y) + { + std::swap_ranges(currentRowPtr, nextRowPtr, reverseRowPtr); + currentRowPtr = nextRowPtr; + nextRowPtr += stride; + reverseRowPtr -= stride; + } + } } #else From e2e0f36d985279a8ffdc366551fd67537e9588f5 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Mon, 23 Oct 2023 18:20:08 -0500 Subject: [PATCH 4/6] Fix warnings in Linux OpenGL ES codepaths Because CI didn't cover this code we didn't know there were warnings in these codepaths to address. Not sure why GCC's -Wduplicated-branches is being emitted or how exactly to fix it. It's easier to simply ignore it in this one particular file. --- .github/workflows/ci.yml | 1 + changelog.md | 1 + src/SFML/Graphics/RenderTextureImplFBO.cpp | 2 +- src/SFML/Graphics/Texture.cpp | 14 ++++++++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30755fe3d..6f0841e4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: - { name: Windows VS2022 Clang, os: windows-2022, flags: -T ClangCL } - { name: Linux GCC, os: ubuntu-20.04 } - { name: Linux Clang, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } + - { name: Linux GCC OpenGL ES, os: ubuntu-20.04, flags: -DSFML_OPENGL_ES=ON } - { name: MacOS XCode, os: macos-11 } config: - { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE } diff --git a/changelog.md b/changelog.md index 1b64ba39b..adf5f69cb 100644 --- a/changelog.md +++ b/changelog.md @@ -24,6 +24,7 @@ Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.6.1 **Bugfixes** - Ensure OpenGL extensions are loaded before querying maximum texture size (#2603) +- Fix warnings in Linux OpenGL ES codepaths (#2747) ### Audio diff --git a/src/SFML/Graphics/RenderTextureImplFBO.cpp b/src/SFML/Graphics/RenderTextureImplFBO.cpp index eab97150a..295577b4a 100644 --- a/src/SFML/Graphics/RenderTextureImplFBO.cpp +++ b/src/SFML/Graphics/RenderTextureImplFBO.cpp @@ -387,7 +387,7 @@ bool RenderTextureImplFBO::create(unsigned int width, unsigned int height, unsig if (createFrameBuffer()) { // Restore previously bound framebuffer - glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, frameBuffer)); + glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, static_cast(frameBuffer))); return true; } diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index a6648bef7..1600c3b4b 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -38,6 +38,10 @@ #include #include +#if defined(__GNUC__) + #pragma GCC diagnostic ignored "-Wduplicated-branches" +#endif + namespace { @@ -346,10 +350,16 @@ Image Texture::copyToImage() const glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, frameBuffer)); glCheck(GLEXT_glFramebufferTexture2D(GLEXT_GL_FRAMEBUFFER, GLEXT_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture, 0)); - glCheck(glReadPixels(0, 0, m_size.x, m_size.y, GL_RGBA, GL_UNSIGNED_BYTE, &pixels[0])); + glCheck(glReadPixels(0, + 0, + static_cast(m_size.x), + static_cast(m_size.y), + GL_RGBA, + GL_UNSIGNED_BYTE, + &pixels[0])); glCheck(GLEXT_glDeleteFramebuffers(1, &frameBuffer)); - glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, previousFrameBuffer)); + glCheck(GLEXT_glBindFramebuffer(GLEXT_GL_FRAMEBUFFER, static_cast(previousFrameBuffer))); if (m_pixelsFlipped) { From 7f57bb4fe603a86e94323a1f9aab8f564ca975fd Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 4 Oct 2023 15:21:32 -0600 Subject: [PATCH 5/6] Update version to 2.6.1 --- CMakeLists.txt | 2 +- examples/assets/info.plist | 2 +- include/SFML/Config.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e3f89df3..fc9a268e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ include(GNUInstallDirs) # setup version numbers set(VERSION_MAJOR 2) set(VERSION_MINOR 6) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) # add an option for choosing the build type (shared or static) if(NOT (SFML_OS_IOS OR SFML_OS_ANDROID)) diff --git a/examples/assets/info.plist b/examples/assets/info.plist index f8c7c5447..655be45e2 100644 --- a/examples/assets/info.plist +++ b/examples/assets/info.plist @@ -17,7 +17,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleLongVersionString - 2.6.0 + 2.6.1 CFBundleName $(EXECUTABLE_NAME) CFBundlePackageType diff --git a/include/SFML/Config.hpp b/include/SFML/Config.hpp index f4ea4ef3e..3093a7a51 100644 --- a/include/SFML/Config.hpp +++ b/include/SFML/Config.hpp @@ -31,7 +31,7 @@ //////////////////////////////////////////////////////////// #define SFML_VERSION_MAJOR 2 #define SFML_VERSION_MINOR 6 -#define SFML_VERSION_PATCH 0 +#define SFML_VERSION_PATCH 1 //////////////////////////////////////////////////////////// From 69ea0cd863aed1d4092b970b676924a716ff718b Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 17 Oct 2023 14:18:36 -0500 Subject: [PATCH 6/6] Update changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index adf5f69cb..ead194401 100644 --- a/changelog.md +++ b/changelog.md @@ -24,6 +24,7 @@ Also available on the website: https://www.sfml-dev.org/changelog.php#sfml-2.6.1 **Bugfixes** - Ensure OpenGL extensions are loaded before querying maximum texture size (#2603) +- Fixed RenderTexture being upside down on Android (#2730) - Fix warnings in Linux OpenGL ES codepaths (#2747) ### Audio