From 413c6d7d0672749b5f2ea610613a3800b4e6c272 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 11 Nov 2025 15:18:42 +0100 Subject: [PATCH 1/7] Set correct primitive type (triangle strip) for user sprites --- src/libprojectM/UserSprites/MilkdropSprite.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libprojectM/UserSprites/MilkdropSprite.cpp b/src/libprojectM/UserSprites/MilkdropSprite.cpp index a5edd67ee..aa5c4bf49 100644 --- a/src/libprojectM/UserSprites/MilkdropSprite.cpp +++ b/src/libprojectM/UserSprites/MilkdropSprite.cpp @@ -28,6 +28,7 @@ namespace UserSprites { MilkdropSprite::MilkdropSprite() : m_mesh(Renderer::VertexBufferUsage::DynamicDraw, false, true) { + m_mesh.SetRenderPrimitiveType(Renderer::Mesh::PrimitiveType::TriangleStrip); m_mesh.SetVertexCount(4); } From 5158ecbf7a50a60dbac260d09f417de02a95c2d4 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Tue, 11 Nov 2025 15:39:43 +0100 Subject: [PATCH 2/7] Load image file and create texture separately with SOIL2 The new combined function no longer returns the image size, so we need to load the image ourselves, store the size and then pass the buffer to SOIL_create_OGL_texture(). --- src/libprojectM/Renderer/TextureManager.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/libprojectM/Renderer/TextureManager.cpp b/src/libprojectM/Renderer/TextureManager.cpp index 858c7b779..ebed793ba 100644 --- a/src/libprojectM/Renderer/TextureManager.cpp +++ b/src/libprojectM/Renderer/TextureManager.cpp @@ -212,13 +212,23 @@ auto TextureManager::LoadTexture(const ScannedFile& file) -> std::shared_ptr imageData(SOIL_load_image(file.filePath.c_str(), &width, &height, &channels, SOIL_LOAD_RGBA), SOIL_free_image_data); + + if (imageData == nullptr) + { + return {}; + } + + unsigned int const tex = SOIL_create_OGL_texture( + imageData.get(), + &width, &height, SOIL_LOAD_RGBA, SOIL_CREATE_NEW_ID, SOIL_FLAG_MULTIPLY_ALPHA); + imageData.reset(); + if (tex == 0) { return {}; From 09941b5d8dd32cf28deafaecc0ee21dbe034595e Mon Sep 17 00:00:00 2001 From: Michael Baetgen Date: Mon, 10 Nov 2025 23:17:57 -0600 Subject: [PATCH 3/7] use cmake built-in FindOpenGL module for GLES with cmake 3.23+ --- CMakeLists.txt | 6 ++++-- src/libprojectM/projectM4Config.cmake.in | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4c624e54..5a1e69142 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,8 +169,10 @@ else() message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.") endif() - # We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream. - list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles") + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + # We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream. + list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles") + endif() find_package(OpenGL REQUIRED COMPONENTS GLES3) if(NOT TARGET OpenGL::GLES3) message(FATAL_ERROR "No suitable GLES3 library was found.") diff --git a/src/libprojectM/projectM4Config.cmake.in b/src/libprojectM/projectM4Config.cmake.in index 00244c4df..1ca733c9c 100644 --- a/src/libprojectM/projectM4Config.cmake.in +++ b/src/libprojectM/projectM4Config.cmake.in @@ -6,7 +6,9 @@ include(CMakeFindDependencyMacro) if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN if("@ENABLE_GLES@") # ENABLE_GLES - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + endif() find_dependency(OpenGL COMPONENTS GLES3) else() find_dependency(OpenGL) From c19ba3a6d243c885bea430bbaa0e2993eab83cc6 Mon Sep 17 00:00:00 2001 From: Michael Baetgen Date: Mon, 10 Nov 2025 23:17:57 -0600 Subject: [PATCH 4/7] use cmake built-in FindOpenGL module for GLES with cmake 3.23+ --- CMakeLists.txt | 6 ++++-- src/libprojectM/projectM4Config.cmake.in | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4c624e54..5a1e69142 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,8 +169,10 @@ else() message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.") endif() - # We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream. - list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles") + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + # We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream. + list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles") + endif() find_package(OpenGL REQUIRED COMPONENTS GLES3) if(NOT TARGET OpenGL::GLES3) message(FATAL_ERROR "No suitable GLES3 library was found.") diff --git a/src/libprojectM/projectM4Config.cmake.in b/src/libprojectM/projectM4Config.cmake.in index 00244c4df..1ca733c9c 100644 --- a/src/libprojectM/projectM4Config.cmake.in +++ b/src/libprojectM/projectM4Config.cmake.in @@ -6,7 +6,9 @@ include(CMakeFindDependencyMacro) if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN if("@ENABLE_GLES@") # ENABLE_GLES - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + endif() find_dependency(OpenGL COMPONENTS GLES3) else() find_dependency(OpenGL) From 6858e7be4bf24f7e9ecb3e65c4e03105554dfad1 Mon Sep 17 00:00:00 2001 From: Michael Baetgen <236306304+mbaetgen-wup@users.noreply.github.com> Date: Mon, 15 Dec 2025 03:54:57 -0600 Subject: [PATCH 5/7] Update src/libprojectM/projectM4Config.cmake.in Co-authored-by: Kai Blaschke --- src/libprojectM/projectM4Config.cmake.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libprojectM/projectM4Config.cmake.in b/src/libprojectM/projectM4Config.cmake.in index 1ca733c9c..ea411f34e 100644 --- a/src/libprojectM/projectM4Config.cmake.in +++ b/src/libprojectM/projectM4Config.cmake.in @@ -7,9 +7,13 @@ include(CMakeFindDependencyMacro) if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN if("@ENABLE_GLES@") # ENABLE_GLES if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + set(PROJECTM4_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + find_dependency(OpenGL COMPONENTS GLES3) + set(CMAKE_MODULE_PATH ${PROJECTM4_PREV_MODULE_PATH}) + else() + find_dependency(OpenGL COMPONENTS GLES3) endif() - find_dependency(OpenGL COMPONENTS GLES3) else() find_dependency(OpenGL) endif() From ad857fdcd7523275a64308c39d700db997ee9bfc Mon Sep 17 00:00:00 2001 From: Michael Baetgen <236306304+mbaetgen-wup@users.noreply.github.com> Date: Mon, 15 Dec 2025 03:56:58 -0600 Subject: [PATCH 6/7] Update CMakeLists.txt Co-authored-by: Kai Blaschke --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a1e69142..c774b983e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -169,7 +169,7 @@ else() message(FATAL_ERROR "OpenGL ES 3 support is currently only available for Linux platforms. You're building for ${CMAKE_SYSTEM_NAME}.") endif() - if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.26" OR CMAKE_SYSTEM_NAME STREQUAL Android) # We use a local find script for OpenGL::GLES3 until the proposed changes are merged upstream. list(APPEND CMAKE_MODULE_PATH "${PROJECTM_SOURCE_DIR}/cmake/gles") endif() From 9aa20311083e4a05fb4b24ee9b06140e02f71066 Mon Sep 17 00:00:00 2001 From: Michael Baetgen Date: Mon, 15 Dec 2025 04:04:08 -0600 Subject: [PATCH 7/7] fix version / readme --- cmake/gles/README.md | 6 +++--- src/libprojectM/projectM4Config.cmake.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/gles/README.md b/cmake/gles/README.md index 4ab81ff55..5fdfffd52 100644 --- a/cmake/gles/README.md +++ b/cmake/gles/README.md @@ -1,7 +1,7 @@ # GLES3 Find Script The OpenGL CMake find script in this directory contains additional code to find GLES versions 1 to 3. It was taken from -CMake 3.22 and patched accordingly. A merge request is underway upstream, so ideally, this will be part of CMake 3.23+. +CMake 3.22 and patched accordingly. A merge request was accepted upstream, it is part of CMake 3.27. -In the meantime, we'll use this script as a local copy if GLES3 support is requested. Will add a version check once it's -in upstream CMake so this file will only be used if the CMake version used to build projectM is too low. \ No newline at end of file +We use this script for CMake lower than 3.27 as a local copy if GLES3 support is requested to provide compatibility. A version check +compares the current CMake version so this file will only be used if the CMake version used to build projectM is too low. \ No newline at end of file diff --git a/src/libprojectM/projectM4Config.cmake.in b/src/libprojectM/projectM4Config.cmake.in index ea411f34e..49338e66c 100644 --- a/src/libprojectM/projectM4Config.cmake.in +++ b/src/libprojectM/projectM4Config.cmake.in @@ -6,7 +6,7 @@ include(CMakeFindDependencyMacro) if(NOT "@ENABLE_EMSCRIPTEN@") # ENABLE_EMSCRIPTEN if("@ENABLE_GLES@") # ENABLE_GLES - if (CMAKE_VERSION VERSION_LESS_EQUAL "3.22" OR CMAKE_SYSTEM_NAME STREQUAL Android) + if (CMAKE_VERSION VERSION_LESS_EQUAL "3.26" OR CMAKE_SYSTEM_NAME STREQUAL Android) set(PROJECTM4_PREV_MODULE_PATH ${CMAKE_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") find_dependency(OpenGL COMPONENTS GLES3)