Skip to content

Commit 3e67f6e

Browse files
kholbrook1303kblaschke
authored andcommitted
Update SOIL2 to v1.31 to fix issue with GL_OES_texture_npot
Resolves issue #910 Fail over to glGetString if SOIL_GL_GetProcAddress fails Signed-off-by: Kai Blaschke <[email protected]>
1 parent 1050d61 commit 3e67f6e

31 files changed

+6423
-3075
lines changed

src/libprojectM/Renderer/TextureManager.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ auto TextureManager::GetSampler(const std::string& fullName) -> std::shared_ptr<
6565
void TextureManager::Preload()
6666
{
6767
// Create samplers
68-
m_samplers.emplace(std::pair<GLint, GLint>(GL_CLAMP_TO_EDGE, GL_LINEAR), std::make_shared<Sampler>(GL_CLAMP_TO_EDGE, GL_LINEAR));
69-
m_samplers.emplace(std::pair<GLint, GLint>(GL_CLAMP_TO_EDGE, GL_NEAREST), std::make_shared<Sampler>(GL_CLAMP_TO_EDGE, GL_NEAREST));
70-
m_samplers.emplace(std::pair<GLint, GLint>(GL_REPEAT, GL_LINEAR), std::make_shared<Sampler>(GL_REPEAT, GL_LINEAR));
71-
m_samplers.emplace(std::pair<GLint, GLint>(GL_REPEAT, GL_NEAREST), std::make_shared<Sampler>(GL_REPEAT, GL_NEAREST));
68+
m_samplers.emplace(std::make_pair(GL_CLAMP_TO_EDGE, GL_LINEAR), std::make_shared<Sampler>(GL_CLAMP_TO_EDGE, GL_LINEAR));
69+
m_samplers.emplace(std::make_pair(GL_CLAMP_TO_EDGE, GL_NEAREST), std::make_shared<Sampler>(GL_CLAMP_TO_EDGE, GL_NEAREST));
70+
m_samplers.emplace(std::make_pair(GL_REPEAT, GL_LINEAR), std::make_shared<Sampler>(GL_REPEAT, GL_LINEAR));
71+
m_samplers.emplace(std::make_pair(GL_REPEAT, GL_NEAREST), std::make_shared<Sampler>(GL_REPEAT, GL_NEAREST));
7272

7373
int width{};
7474
int height{};
@@ -78,7 +78,7 @@ void TextureManager::Preload()
7878
M_bytes,
7979
SOIL_LOAD_AUTO,
8080
SOIL_CREATE_NEW_ID,
81-
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
81+
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA);
8282

8383
m_textures["idlem"] = std::make_shared<Texture>("idlem", tex, GL_TEXTURE_2D, width, height, false);;
8484

@@ -87,7 +87,7 @@ void TextureManager::Preload()
8787
headphones_bytes,
8888
SOIL_LOAD_AUTO,
8989
SOIL_CREATE_NEW_ID,
90-
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
90+
SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_MULTIPLY_ALPHA);
9191

9292
m_textures["idleheadphones"] = std::make_shared<Texture>("idleheadphones", tex, GL_TEXTURE_2D, width, height, false);;
9393

@@ -217,7 +217,7 @@ auto TextureManager::LoadTexture(const ScannedFile& file) -> std::shared_ptr<Tex
217217
file.filePath.c_str(),
218218
SOIL_LOAD_RGBA,
219219
SOIL_CREATE_NEW_ID,
220-
SOIL_FLAG_MULTIPLY_ALPHA, &width, &height);
220+
SOIL_FLAG_MULTIPLY_ALPHA);
221221

222222
if (tex == 0)
223223
{

vendor/SOIL2/CMakeLists.txt

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
add_library(SOIL2 OBJECT
2-
etc1_utils.c
3-
etc1_utils.h
4-
image_DXT.c
5-
image_DXT.h
6-
image_helper.c
7-
image_helper.h
8-
pkm_helper.h
9-
pvr_helper.h
10-
SOIL2.c
11-
SOIL2.h
12-
stb_image.h
13-
stb_image_write.h
14-
stbi_DDS.h
15-
stbi_DDS_c.h
16-
stbi_ext.h
17-
stbi_ext_c.h
18-
stbi_pkm.h
19-
stbi_pkm_c.h
20-
stbi_pvr.h
21-
stbi_pvr_c.h
2+
${CMAKE_CURRENT_SOURCE_DIR}/src/common/common.cpp
3+
${CMAKE_CURRENT_SOURCE_DIR}/src/common/common.hpp
4+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/image_DXT.c
5+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/image_DXT.h
6+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/image_helper.c
7+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/image_helper.h
8+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/pkm_helper.h
9+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/pvr_helper.h
10+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/SOIL2.c
11+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/SOIL2.h
12+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stb_image.h
13+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stb_image_write.h
14+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_DDS.h
15+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_DDS_c.h
16+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_ext.h
17+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_ext_c.h
18+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_pkm.h
19+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_pkm_c.h
20+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_pvr.h
21+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_pvr_c.h
22+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_qoi.h
23+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_qoi_c.h
24+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/stbi_qoi_write.h
25+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/wfETC.c
26+
${CMAKE_CURRENT_SOURCE_DIR}/src/SOIL2/wfETC.h
2227
)
2328

2429
target_include_directories(SOIL2
25-
PRIVATE
26-
"."
2730
PUBLIC
28-
"${CMAKE_CURRENT_SOURCE_DIR}/.."
31+
"${CMAKE_CURRENT_SOURCE_DIR}/src"
2932
)
3033

3134
target_link_libraries(SOIL2
@@ -36,15 +39,21 @@ target_link_libraries(SOIL2
3639
if(USE_GLES)
3740
target_compile_definitions(SOIL2
3841
PRIVATE
39-
SOIL_GLES3
40-
SOIL_NO_EGL
42+
SOIL_GLES2
4143
)
4244
target_link_libraries(SOIL2
4345
PUBLIC
4446
${CMAKE_DL_LIBS}
4547
)
4648
endif()
47-
49+
50+
if(NOT TARGET OpenGL::EGL)
51+
target_compile_definitions(SOIL2
52+
PRIVATE
53+
SOIL_NO_EGL
54+
)
55+
endif()
56+
4857
set_target_properties(SOIL2 PROPERTIES
49-
FOLDER libprojectM
58+
FOLDER vendor/SOIL2
5059
)

0 commit comments

Comments
 (0)