[arch-commits] Commit in iempluginsuite/trunk (2 files)
David Runge
dvzrv at gemini.archlinux.org
Mon Sep 27 21:41:37 UTC 2021
Date: Monday, September 27, 2021 @ 21:41:36
Author: dvzrv
Revision: 1025796
upgpkg: iempluginsuite 1.12.0-1: Upgrade to 1.12.0.
Add patch for juce >= 6.1, qualifying all used GL functionality with juce::gl::.
Add CPPFLAGS override for juce >= 6.1 to build with deprecated non-asynchronous modal loops.
Added:
iempluginsuite/trunk/iempluginsuite-1.12.0-juce_gl.patch
Modified:
iempluginsuite/trunk/PKGBUILD
-------------------------------------+
PKGBUILD | 30 +-
iempluginsuite-1.12.0-juce_gl.patch | 396 ++++++++++++++++++++++++++++++++++
2 files changed, 417 insertions(+), 9 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-09-27 21:13:03 UTC (rev 1025795)
+++ PKGBUILD 2021-09-27 21:41:36 UTC (rev 1025796)
@@ -2,7 +2,7 @@
_name=IEMPluginSuite
pkgname=iempluginsuite
-pkgver=1.11.1
+pkgver=1.12.0
pkgrel=1
pkgdesc="Plug-in suite including Ambisonic plug-ins up to 7th order"
arch=('x86_64')
@@ -9,14 +9,16 @@
url="https://plugins.iem.at"
license=('GPL3')
groups=('pro-audio' 'vst-plugins')
-depends=('gcc-libs' 'glibc' 'libglvnd' 'libjpeg-turbo' 'libogg' 'libpng'
-'libx11' 'libxext' 'libxinerama' 'zlib')
+depends=('gcc-libs' 'glibc' 'libglvnd' 'libpng'
+'libx11' 'libxcursor' 'libxext' 'libxinerama' 'libxrandr' 'zlib')
makedepends=('alsa-lib' 'curl' 'fftw' 'flac' 'freetype2' 'gendesk' 'jack'
-'juce' 'libvorbis' 'xorg-server-xvfb')
+'juce' 'libjpeg-turbo' 'libogg' 'libvorbis' 'xorg-server-xvfb')
source=("$pkgname-$pkgver.tar.gz::https://git.iem.at/audioplugins/${_name}/-/archive/v${pkgver}/${_name}-v${pkgver}.tar.gz"
+ "${pkgname}-1.12.0-juce_gl.patch"
"$pkgname.directory"
"$pkgname.menu")
-sha512sums=('d811d31723895ace79b4a6000c841db813f3d9b26fa5136c88c42c242b122d9d4f7fdf439c980ed847dc0d1083d7a22d77f909259b209c93a77c4f3c4da1aebd'
+sha512sums=('6178d8baadcf05b5c5bd5281c318a6023377d2b8db91042fbb3100d21930865514271deec98a5577e369c1516d059dd39c0a776cfb64a5071535330db908d52f'
+ '0882d004ed147709f748270efe3f815ec22b3837cb9881f714b3be38d5a7addca8bd818a33e51bc2bf33e4176c1e5add5d01c5eb45aa4f9e3560784812e659bd'
'412ac2581089babfe57b10c06dca86c19a8b708b76af70283d3b35dd1deffc8f7c654d9e7d182da8b0fa2f40cafe46fc855890e0aed7d11530de3c0d56bf17dd'
'2d290b5b8c9320013abb97e0a9051c6687a92700433454c88d4c89fe122c9b1537e128faf7060715c63eb28e93ad9f3f1a98765a7a5934e4f8bd0a8c20254ab3')
_standalones=('AllRADecoder' 'BinauralDecoder' 'CoordinateConverter'
@@ -82,10 +84,15 @@
--genericname "${generic[$name]}" \
--categories "${pkgname}"
done
+
+ # fix issue with juce::gl namespaces
+ # https://git.iem.at/audioplugins/IEMPluginSuite/-/issues/121
+ patch -Np1 -i ../"${pkgname}-1.12.0-juce_gl.patch"
}
build() {
cd "$pkgname-$pkgver"
+
for _jucer in */*.jucer; do
_name="$(dirname ${_jucer})"
ln -sv ../resources/ "${_name}/"
@@ -92,15 +99,19 @@
xvfb-run Projucer --resave "${_jucer}"
# remove -march=native as only supplying -DTARGET_ARCH is not enough
sed -e 's/\-march=native//g' -i "${_name}/Builds/LinuxMakefile/Makefile"
- CPPFLAGS+=" -I/usr/share/juce/modules/juce_audio_processors/format_types/ -DJUCE_JACK=1" \
- make CONFIG=Release AR=gcc-ar -j$(nproc) V=1 -C "${_name}/Builds/LinuxMakefile"
+
+ # enable synchronous modal loops again:
+ # https://git.iem.at/audioplugins/IEMPluginSuite/-/issues/120
+ export CPPFLAGS+=" -DJUCE_MODAL_LOOPS_PERMITTED=1"
+ make CONFIG=Release AR=gcc-ar -j$(nproc) V=1 -C "${_name}/Builds/LinuxMakefile"
done
}
package() {
depends+=('libasound.so' 'libcurl.so' 'libFLAC.so' 'libfftw3f.so'
- 'libfreetype.so' 'libjack.so' 'libvorbis.so' 'libvorbisenc.so'
- 'libvorbisfile.so')
+ 'libfreetype.so' 'libjack.so' 'libjpeg.so' 'libogg.so' 'libvorbis.so'
+ 'libvorbisenc.so' 'libvorbisfile.so')
+
cd "$pkgname-$pkgver"
for _jucer in */*.jucer; do
_name="$(dirname "${_jucer}")"
@@ -109,6 +120,7 @@
install -vDm 755 "${_name}/Builds/LinuxMakefile/build/${_name##_}.so" \
-t "${pkgdir}/usr/lib/vst"
done
+
# XDG desktop integration
install -vDm 644 *.desktop -t "${pkgdir}/usr/share/applications"
install -vDm 644 "../${pkgname}.menu" \
Added: iempluginsuite-1.12.0-juce_gl.patch
===================================================================
--- iempluginsuite-1.12.0-juce_gl.patch (rev 0)
+++ iempluginsuite-1.12.0-juce_gl.patch 2021-09-27 21:41:36 UTC (rev 1025796)
@@ -0,0 +1,396 @@
+diff -ruN a/AllRADecoder/Source/LoudspeakerVisualizer.h b/AllRADecoder/Source/LoudspeakerVisualizer.h
+--- a/AllRADecoder/Source/LoudspeakerVisualizer.h 2021-02-02 17:01:39.000000000 +0100
++++ b/AllRADecoder/Source/LoudspeakerVisualizer.h 2021-09-26 21:51:52.950367173 +0200
+@@ -78,13 +78,13 @@
+
+
+
+- openGLContext.extensions.glActiveTexture (GL_TEXTURE0);
+- glEnable (GL_TEXTURE_2D);
++ openGLContext.extensions.glActiveTexture (juce::gl::GL_TEXTURE0);
++ juce::gl::glEnable (juce::gl::GL_TEXTURE_2D);
+
+
+ texture.bind();
+- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // linear interpolation when too small
+- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // linear interpolation when too bi
++ juce::gl::glTexParameteri(juce::gl::GL_TEXTURE_2D, juce::gl::GL_TEXTURE_MIN_FILTER, juce::gl::GL_LINEAR); // linear interpolation when too small
++ juce::gl::glTexParameteri(juce::gl::GL_TEXTURE_2D, juce::gl::GL_TEXTURE_MAG_FILTER, juce::gl::GL_LINEAR); // linear interpolation when too bi
+ }
+
+ void newOpenGLContextCreated() override
+@@ -172,16 +172,16 @@
+ openGLContext.extensions.glDeleteBuffers(1, &normalsBuffer);
+
+ openGLContext.extensions.glGenBuffers(1, &vertexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
+- openGLContext.extensions.glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(positionAndColour), &vertices[0], GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, vertexBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ARRAY_BUFFER, vertices.size() * sizeof(positionAndColour), &vertices[0], juce::gl::GL_STATIC_DRAW);
+
+ openGLContext.extensions.glGenBuffers(1, &indexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
+- openGLContext.extensions.glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(int), &indices[0], GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(int), &indices[0], juce::gl::GL_STATIC_DRAW);
+
+ openGLContext.extensions.glGenBuffers(1, &normalsBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, normalsBuffer);
+- openGLContext.extensions.glBufferData(GL_ARRAY_BUFFER, normals.size() * sizeof(float), &normals[0], GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, normalsBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ARRAY_BUFFER, normals.size() * sizeof(float), &normals[0], juce::gl::GL_STATIC_DRAW);
+ }
+
+ void renderOpenGL() override
+@@ -193,19 +193,19 @@
+ juce::OpenGLHelpers::clear (juce::Colour(0xFF2D2D2D));
+
+ const float desktopScale = (float) openGLContext.getRenderingScale();
+- glViewport (0, 0, juce::roundToInt (desktopScale * getWidth()), juce::roundToInt (desktopScale * getHeight()));
++ juce::gl::glViewport (0, 0, juce::roundToInt (desktopScale * getWidth()), juce::roundToInt (desktopScale * getHeight()));
+
+- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+- glEnable (GL_DEPTH_TEST);
++ juce::gl::glClear(juce::gl::GL_COLOR_BUFFER_BIT | juce::gl::GL_DEPTH_BUFFER_BIT);
++ juce::gl::glEnable (juce::gl::GL_DEPTH_TEST);
+
+ #ifdef JUCE_OPENGL3
+- glEnable(GL_BLEND);
+- glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+- glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
++ juce::gl::glEnable(juce::gl::GL_BLEND);
++ juce::gl::glBlendFuncSeparate(juce::gl::GL_SRC_ALPHA, juce::gl::GL_ONE_MINUS_SRC_ALPHA, juce::gl::GL_ONE, juce::gl::GL_ONE_MINUS_SRC_ALPHA);
++ glBlendEquationSeparate(juce::gl::GL_FUNC_ADD, juce::gl::GL_FUNC_ADD);
+ #endif
+
+- openGLContext.extensions.glActiveTexture (GL_TEXTURE0);
+- glEnable (GL_TEXTURE_2D);
++ openGLContext.extensions.glActiveTexture (juce::gl::GL_TEXTURE0);
++ juce::gl::glEnable (juce::gl::GL_TEXTURE_2D);
+ texture.bind();
+
+ if (updatedBuffers)
+@@ -232,14 +232,14 @@
+ // 1st attribute buffer : vertices
+ attributeID = openGLContext.extensions.glGetAttribLocation(programID, "position");
+ openGLContext.extensions.glEnableVertexAttribArray(attributeID);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, vertexBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
+
+ openGLContext.extensions.glVertexAttribPointer(
+ attributeID, // attribute 0. No particular reason for 0, but must match the layout in the shader.
+ 3, // size
+- GL_FLOAT, // type
+- GL_FALSE, // normalized?
++ juce::gl::GL_FLOAT, // type
++ juce::gl::GL_FALSE, // normalized?
+ sizeof(positionAndColour), // stride
+ (void*)0 // array buffer offset
+ );
+@@ -247,13 +247,13 @@
+ // 2nd attribute buffer : normals
+ attributeID = openGLContext.extensions.glGetAttribLocation(programID, "normals");
+ openGLContext.extensions.glEnableVertexAttribArray(attributeID);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, normalsBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, normalsBuffer);
+
+ openGLContext.extensions.glVertexAttribPointer(
+ attributeID, // attribute 0. No particular reason for 0, but must match the layout in the shader.
+ 3, // size
+- GL_FLOAT, // type
+- GL_FALSE, // normalized?
++ juce::gl::GL_FLOAT, // type
++ juce::gl::GL_FALSE, // normalized?
+ 0, // stride
+ (void*)0 // array buffer offset
+ );
+@@ -261,18 +261,18 @@
+ // 3rd attribute buffer : colors
+ attributeID = openGLContext.extensions.glGetAttribLocation(programID, "colormapDepthIn");
+ openGLContext.extensions.glEnableVertexAttribArray(attributeID);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, vertexBuffer);
+
+ openGLContext.extensions.glVertexAttribPointer(
+ attributeID, // attribute
+ 1, // size
+- GL_FLOAT, // type
+- GL_TRUE, // normalized?
++ juce::gl::GL_FLOAT, // type
++ juce::gl::GL_TRUE, // normalized?
+ sizeof(positionAndColour), // stride
+ (void*) offsetof(positionAndColour, colourId) // array buffer offset
+ );
+
+- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
++ juce::gl::glPolygonMode(juce::gl::GL_FRONT_AND_BACK, juce::gl::GL_FILL);
+
+ if (blackFlag != nullptr)
+ blackFlag->set(0.0f);
+@@ -283,13 +283,13 @@
+
+ if (alpha != nullptr)
+ alpha->set(0.0f);
+- glDisable(GL_CULL_FACE);
+- glDepthFunc(GL_ALWAYS); // priming depth buffer
+- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+- glDrawElements(
+- GL_TRIANGLES, // mode
++ juce::gl::glDisable(juce::gl::GL_CULL_FACE);
++ juce::gl::glDepthFunc(juce::gl::GL_ALWAYS); // priming depth buffer
++ juce::gl::glPolygonMode(juce::gl::GL_FRONT_AND_BACK, juce::gl::GL_FILL);
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ nTriangles * 3, // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*) (nPoints * sizeof(int)) // element array buffer offset
+ );
+
+@@ -300,62 +300,62 @@
+ // draw points
+ if (drawPointsFlag != nullptr)
+ drawPointsFlag->set(1.0f);
+- glPointSize(8 * desktopScale);
+- glDepthFunc(GL_ALWAYS);
+- glDrawElements(GL_POINTS, nPoints, GL_UNSIGNED_INT, (void*)0); // Draw points!
++ juce::gl::glPointSize(8 * desktopScale);
++ juce::gl::glDepthFunc(juce::gl::GL_ALWAYS);
++ juce::gl::glDrawElements(juce::gl::GL_POINTS, nPoints, juce::gl::GL_UNSIGNED_INT, (void*)0); // Draw points!
+ if (drawPointsFlag != nullptr)
+ drawPointsFlag->set(0.0f);
+ // draw background first (inward facing triangles in the background -> looking towards us)
+- glEnable(GL_CULL_FACE);
+- glCullFace(GL_BACK);
+- glDepthFunc(GL_ALWAYS);
+- glDrawElements(
+- GL_TRIANGLES, // mode
++ juce::gl::glEnable(juce::gl::GL_CULL_FACE);
++ juce::gl::glCullFace(juce::gl::GL_BACK);
++ juce::gl::glDepthFunc(juce::gl::GL_ALWAYS);
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ nTriangles * 3, // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*) (nPoints * sizeof(int)) // element array buffer offset
+ );
+
+ // render black lines (all)
+- glLineWidth(2.5 * desktopScale);
+- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
++ juce::gl::glLineWidth(2.5 * desktopScale);
++ juce::gl::glPolygonMode(juce::gl::GL_FRONT_AND_BACK, juce::gl::GL_LINE);
+ if (blackFlag != nullptr)
+ blackFlag->set(1.0f);
+
+- glDrawElements(
+- GL_TRIANGLES, // mode
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ nTriangles * 3, // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*) (nPoints * sizeof(int)) // element array buffer offset
+ );
+
+ if (blackFlag != nullptr)
+ blackFlag->set(0.0f);
+- glPolygonMode(GL_FRONT_AND_BACK, GL_FILL
++ juce::gl::glPolygonMode(juce::gl::GL_FRONT_AND_BACK, juce::gl::GL_FILL
+ );
+
+ // draw foreground triangles
+- glEnable(GL_CULL_FACE);
+- glCullFace(GL_FRONT);
+- glDepthFunc(GL_ALWAYS);
+- glDrawElements(
+- GL_TRIANGLES, // mode
++ juce::gl::glEnable(juce::gl::GL_CULL_FACE);
++ juce::gl::glCullFace(juce::gl::GL_FRONT);
++ juce::gl::glDepthFunc(juce::gl::GL_ALWAYS);
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ nTriangles * 3, // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*) (nPoints * sizeof(int)) // element array buffer offset
+ );
+
+ // render black lines (foreground)
+- glLineWidth(2.5 * desktopScale);
+- glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+- glDepthFunc(GL_LEQUAL);
++ juce::gl::glLineWidth(2.5 * desktopScale);
++ juce::gl::glPolygonMode(juce::gl::GL_FRONT_AND_BACK, juce::gl::GL_LINE);
++ juce::gl::glDepthFunc(juce::gl::GL_LEQUAL);
+ if (blackFlag != nullptr)
+ blackFlag->set(1.0f);
+
+- glDrawElements(
+- GL_TRIANGLES, // mode
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ nTriangles * 3, // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*) (nPoints * sizeof(int)) // element array buffer offset
+ );
+
+@@ -364,9 +364,9 @@
+ drawPointsFlag->set(1.0f);
+ if (blackFlag != nullptr)
+ blackFlag->set(0.0f);
+- glPointSize(8 * desktopScale);
+- glDepthFunc(GL_LEQUAL);
+- glDrawElements(GL_POINTS, nPoints, GL_UNSIGNED_INT, (void*)0); // Draw points!
++ juce::gl::glPointSize(8 * desktopScale);
++ juce::gl::glDepthFunc(juce::gl::GL_LEQUAL);
++ juce::gl::glDrawElements(juce::gl::GL_POINTS, nPoints, juce::gl::GL_UNSIGNED_INT, (void*)0); // Draw points!
+ if (drawPointsFlag != nullptr)
+ drawPointsFlag->set(0.0f);
+
+@@ -374,8 +374,8 @@
+ openGLContext.extensions.glDisableVertexAttribArray(openGLContext.extensions.glGetAttribLocation(programID, "normals"));
+ openGLContext.extensions.glDisableVertexAttribArray(openGLContext.extensions.glGetAttribLocation(programID, "colormapDepthIn"));
+
+- openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
+- openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
++ openGLContext.extensions.glBindBuffer (juce::gl::GL_ARRAY_BUFFER, 0);
++ openGLContext.extensions.glBindBuffer (juce::gl::GL_ELEMENT_ARRAY_BUFFER, 0);
+ }
+
+ void openGLContextClosing() override {
+diff -ruN a/EnergyVisualizer/Source/VisualizerComponent.h b/EnergyVisualizer/Source/VisualizerComponent.h
+--- a/EnergyVisualizer/Source/VisualizerComponent.h 2021-02-02 17:01:39.000000000 +0100
++++ b/EnergyVisualizer/Source/VisualizerComponent.h 2021-09-26 21:51:37.766974887 +0200
+@@ -87,21 +87,21 @@
+ juce::OpenGLHelpers::clear (juce::Colour(0xFF2D2D2D));
+
+ const float desktopScale = (float) openGLContext.getRenderingScale();
+- glViewport (-5, -5, juce::roundToInt (desktopScale * getWidth()+10), juce::roundToInt (desktopScale * getHeight()+10));
++ juce::gl::glViewport (-5, -5, juce::roundToInt (desktopScale * getWidth()+10), juce::roundToInt (desktopScale * getHeight()+10));
+
+- glEnable (GL_DEPTH_TEST);
+- glDepthFunc (GL_LESS);
+- glEnable (GL_BLEND);
+- glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+- openGLContext.extensions.glActiveTexture (GL_TEXTURE0);
+- glEnable (GL_TEXTURE_2D);
++ juce::gl::glEnable (juce::gl::GL_DEPTH_TEST);
++ juce::gl::glDepthFunc (juce::gl::GL_LESS);
++ juce::gl::glEnable (juce::gl::GL_BLEND);
++ juce::gl::glBlendFunc (juce::gl::GL_SRC_ALPHA, juce::gl::GL_ONE_MINUS_SRC_ALPHA);
++ openGLContext.extensions.glActiveTexture (juce::gl::GL_TEXTURE0);
++ juce::gl::glEnable (juce::gl::GL_TEXTURE_2D);
+
+ texture.bind();
+- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // linear interpolation when too small
+- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // linear interpolation when too bi
++ juce::gl::glTexParameteri(juce::gl::GL_TEXTURE_2D, juce::gl::GL_TEXTURE_MIN_FILTER, juce::gl::GL_LINEAR); // linear interpolation when too small
++ juce::gl::glTexParameteri(juce::gl::GL_TEXTURE_2D, juce::gl::GL_TEXTURE_MAG_FILTER, juce::gl::GL_LINEAR); // linear interpolation when too bi
+
+- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+- glClear(GL_COLOR_BUFFER_BIT);
++ juce::gl::glClear(juce::gl::GL_COLOR_BUFFER_BIT | juce::gl::GL_DEPTH_BUFFER_BIT);
++ juce::gl::glClear(juce::gl::GL_COLOR_BUFFER_BIT);
+
+ shader->use();
+
+@@ -118,12 +118,12 @@
+
+ firstRun = false;
+ openGLContext.extensions.glGenBuffers(1, &vertexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
+- openGLContext.extensions.glBufferData(GL_ARRAY_BUFFER, sizeof(hammerAitovSampleVertices), hammerAitovSampleVertices, GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, vertexBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ARRAY_BUFFER, sizeof(hammerAitovSampleVertices), hammerAitovSampleVertices, juce::gl::GL_STATIC_DRAW);
+
+ openGLContext.extensions.glGenBuffers(1, &indexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
+- openGLContext.extensions.glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(hammerAitovSampleIndices), hammerAitovSampleIndices, GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ELEMENT_ARRAY_BUFFER, sizeof(hammerAitovSampleIndices), hammerAitovSampleIndices, juce::gl::GL_STATIC_DRAW);
+ }
+
+ static GLfloat g_colorMap_data[nSamplePoints];
+@@ -135,8 +135,8 @@
+
+ GLuint colorBuffer;
+ openGLContext.extensions.glGenBuffers(1, &colorBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, colorBuffer);
+- openGLContext.extensions.glBufferData(GL_ARRAY_BUFFER, sizeof(g_colorMap_data), g_colorMap_data, GL_STATIC_DRAW);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, colorBuffer);
++ openGLContext.extensions.glBufferData(juce::gl::GL_ARRAY_BUFFER, sizeof(g_colorMap_data), g_colorMap_data, juce::gl::GL_STATIC_DRAW);
+
+ if (colormapChooser != nullptr)
+ colormapChooser->set(usePerceptualColormap ? 0.0f : 1.0f);
+@@ -147,15 +147,15 @@
+ // 1st attribute buffer : vertices
+ attributeID = openGLContext.extensions.glGetAttribLocation(programID,"position");
+ openGLContext.extensions.glEnableVertexAttribArray(attributeID);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
+- openGLContext.extensions.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, vertexBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ELEMENT_ARRAY_BUFFER, indexBuffer);
+
+
+ openGLContext.extensions.glVertexAttribPointer(
+ attributeID, // attribute 0. No particular reason for 0, but must match the layout in the shader.
+ 2, // size
+- GL_FLOAT, // type
+- GL_FALSE, // normalized?
++ juce::gl::GL_FLOAT, // type
++ juce::gl::GL_FALSE, // normalized?
+ 0, // stride
+ (void*)0 // array buffer offset
+ );
+@@ -164,34 +164,34 @@
+ attributeID = openGLContext.extensions.glGetAttribLocation(programID,"colormapDepthIn");
+
+ openGLContext.extensions.glEnableVertexAttribArray(attributeID);
+- openGLContext.extensions.glBindBuffer(GL_ARRAY_BUFFER, colorBuffer);
++ openGLContext.extensions.glBindBuffer(juce::gl::GL_ARRAY_BUFFER, colorBuffer);
+
+ openGLContext.extensions.glVertexAttribPointer(
+ attributeID, // attribute. No particular reason for 1, but must match the layout in the shader.
+ 1, // size
+- GL_FLOAT, // type
+- GL_FALSE, // normalized?
++ juce::gl::GL_FLOAT, // type
++ juce::gl::GL_FALSE, // normalized?
+ 0, // stride
+ (void*)0 // array buffer offset
+ );
+
+- //glDrawElements (GL_TRIANGLES, 3, GL_UNSIGNED_INT, 0); // Draw triangles!
+- //glDrawArrays(GL_TRIANGLES, 0, 3);
++ //juce::gl::glDrawElements (juce::gl::GL_TRIANGLES, 3, juce::gl::GL_UNSIGNED_INT, 0); // Draw triangles!
++ //glDrawArrays(juce::gl::GL_TRIANGLES, 0, 3);
+
+-// glPointSize(20.0);
+-// glDrawElements (GL_POINTS, 100, GL_UNSIGNED_INT, 0); // Draw triangles!
+- glDrawElements(
+- GL_TRIANGLES, // mode
++// juce::gl::glPointSize(20.0);
++// juce::gl::glDrawElements (juce::gl::GL_POINTS, 100, juce::gl::GL_UNSIGNED_INT, 0); // Draw triangles!
++ juce::gl::glDrawElements(
++ juce::gl::GL_TRIANGLES, // mode
+ sizeof(hammerAitovSampleIndices), // count
+- GL_UNSIGNED_INT, // type
++ juce::gl::GL_UNSIGNED_INT, // type
+ (void*)0 // element array buffer offset
+ );
+
+ openGLContext.extensions.glDisableVertexAttribArray(0);
+ openGLContext.extensions.glDisableVertexAttribArray(1);
+
+- openGLContext.extensions.glBindBuffer (GL_ARRAY_BUFFER, 0);
+- openGLContext.extensions.glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, 0);
++ openGLContext.extensions.glBindBuffer (juce::gl::GL_ARRAY_BUFFER, 0);
++ openGLContext.extensions.glBindBuffer (juce::gl::GL_ELEMENT_ARRAY_BUFFER, 0);
+
+ openGLContext.extensions.glDeleteBuffers (1, &colorBuffer);
+
More information about the arch-commits
mailing list