Skip to content

Commit 9aa8bcb

Browse files
committed
Hard-code internal noise texture format for GL Core profiles
glGetInternalformativ() also is an addition in OpenGL Core 4.2, which we don't officially support.
1 parent c30109f commit 9aa8bcb

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/libprojectM/Renderer/MilkdropNoise.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
#include <chrono>
66
#include <random>
77

8-
// Missing in macOS SDK. Query will most certainly fail, but then use the default format.
9-
#ifndef GL_TEXTURE_IMAGE_FORMAT
10-
#define GL_TEXTURE_IMAGE_FORMAT 0x828F
11-
#endif
12-
138
namespace libprojectM {
149
namespace Renderer {
1510

@@ -103,16 +98,12 @@ auto MilkdropNoise::HighQualityVolume() -> std::shared_ptr<Texture>
10398
auto MilkdropNoise::GetPreferredInternalFormat() -> int
10499
{
105100
#ifndef USE_GLES
106-
// Query preferred internal texture format. GLES 3 only supports GL_RENDERBUFFER here, no texture targets.
107-
// That's why we use GL_BGRA as default, as this is the best general-use format according to Khronos.
108-
GLint preferredInternalFormat{GL_BGRA};
109-
glGetInternalformativ(GL_TEXTURE_2D, GL_RGBA8, GL_TEXTURE_IMAGE_FORMAT, sizeof(preferredInternalFormat), &preferredInternalFormat);
101+
// We use GL_BGRA, as this is the best general-use format according to Khronos.
102+
return GL_BGRA;
110103
#else
111104
// GLES only supports GL_RGB and GL_RGBA, so we always use the latter.
112-
GLint preferredInternalFormat{GL_RGBA};
105+
return GL_RGBA;
113106
#endif
114-
115-
return preferredInternalFormat;
116107
}
117108

118109
auto MilkdropNoise::generate2D(int size, int zoomFactor) -> std::vector<uint32_t>

0 commit comments

Comments
 (0)