Date: Thursday, September 15, 2022 @ 18:33:47
  Author: dvzrv
Revision: 1302873

upgpkg: iempluginsuite 1.13.0-1: Upgrade to 1.13.0.

Remove unneeded quotes and curly braces.
Remove unneeded patch.
Add upstreamed patches for using system JUCE and supporting JUCE >= 7.0.0.
Switch to cmake based build system and install standalone and vst3 plugins.

Modified:
  iempluginsuite/trunk/PKGBUILD
Deleted:
  iempluginsuite/trunk/iempluginsuite-1.12.0-juce_gl.patch

-------------------------------------+
 PKGBUILD                            |  143 +++++++-----
 iempluginsuite-1.12.0-juce_gl.patch |  396 ----------------------------------
 2 files changed, 82 insertions(+), 457 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-09-15 18:04:17 UTC (rev 1302872)
+++ PKGBUILD    2022-09-15 18:33:47 UTC (rev 1302873)
@@ -2,34 +2,63 @@
 
 _name=IEMPluginSuite
 pkgname=iempluginsuite
-pkgver=1.12.0
+pkgver=1.13.0
 pkgrel=1
 pkgdesc="Plug-in suite including Ambisonic plug-ins up to 7th order"
-arch=('x86_64')
+arch=(x86_64)
 url="https://plugins.iem.at";
-license=('GPL3')
-groups=('pro-audio' 'vst-plugins')
-depends=('gcc-libs' 'glibc' 'libglvnd' 'libpng'
-'libx11' 'libxcursor' 'libxext' 'libxinerama' 'libxrandr' 'zlib')
-makedepends=('alsa-lib' 'curl' 'fftw' 'flac' 'freetype2' 'gendesk' 'jack'
-'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=('6178d8baadcf05b5c5bd5281c318a6023377d2b8db91042fbb3100d21930865514271deec98a5577e369c1516d059dd39c0a776cfb64a5071535330db908d52f'
-            
'0882d004ed147709f748270efe3f815ec22b3837cb9881f714b3be38d5a7addca8bd818a33e51bc2bf33e4176c1e5add5d01c5eb45aa4f9e3560784812e659bd'
+license=(GPL3)
+groups=(pro-audio vst3-plugins)
+depends=(gcc-libs glibc libglvnd libpng libx11 libxcursor libxext libxinerama
+libxrandr zlib)
+makedepends=(alsa-lib cmake curl fftw freetype2 gendesk jack juce libjpeg-turbo
+xorg-server-xvfb)
+source=(
+  
$pkgname-$pkgver.tar.gz::https://git.iem.at/audioplugins/$_name/-/archive/v$pkgver/$_name-v$pkgver.tar.gz
+  
$pkgname-1.13.0-remove_deps.patch::https://gitlab.com/iem.at/IEMPluginSuite/-/commit/77a12032e41aeda4378180ff84eb11149a732f8f.patch
+  
$pkgname-1.13.0-juce7.patch::https://gitlab.com/dvzrv/IEMPluginSuite/-/commit/439670832afddaedb4d05ea03b0138af847e1249.diff
+  
$pkgname-1.13.0-system_juce.patch::https://gitlab.com/iem.at/IEMPluginSuite/-/commit/f6bfeb08a626b8d7b6a20936145cf69f281e7ab4.patch
+  $pkgname.directory
+  $pkgname.menu
+)
+sha512sums=('9138596e510acb569ab38c30e4d17cc1029c0d0db2a1e02b85126825634d49a2d5915299995227dab04c62dec8b5d5767b5b6209fac777d7045fb5891a9bb718'
+            
'0e7f288f8628f880620aa232dd64b0fe41e06ecffd446c03f1a03b47048a0468316b385a4f94f58fb37906e8c6a1be7c2d2ceae5eb88d5ffcce44c8fe95a8594'
+            
'd30b5935695af09cef33c57881e1fa8bab04cec875e6256887b2595c361adcd883279bea84e2aca66b4535a1ddfac490405fd92a33dd8bbdf325008cecde9992'
+            
'9cc9ceab59bbceb77525be626115eca7ae7d05793def276097a4af2a580592c2c806b69eb1cb0d630990fcfccd01c24bf55081c8b35c76083934ef4adc2ed10c'
             
'412ac2581089babfe57b10c06dca86c19a8b708b76af70283d3b35dd1deffc8f7c654d9e7d182da8b0fa2f40cafe46fc855890e0aed7d11530de3c0d56bf17dd'
             
'2d290b5b8c9320013abb97e0a9051c6687a92700433454c88d4c89fe122c9b1537e128faf7060715c63eb28e93ad9f3f1a98765a7a5934e4f8bd0a8c20254ab3')
-_standalones=('AllRADecoder' 'BinauralDecoder' 'CoordinateConverter'
-'DirectionalCompressor' 'DirectivityShaper' 'DistanceCompensator' 'DualDelay'
-'EnergyVisualizer' 'FdnReverb' 'MatrixMultiplier' 'MultiBandCompressor'
-'MultiEQ' 'MultiEncoder' 'OmniCompressor' 'PluginTemplate' 'ProbeDecoder'
-'RoomEncoder' 'SceneRotator' 'SimpleDecoder' 'StereoEncoder' 'ToolBox')
+b2sums=('483989ab947cdfc01f7030951ab568790d0ca72ab602348aef31d07607ae2a3f25d3ff000ac3bba5f8567ba07c1c2dd4267c8a09df5e126027a907834c5d731b'
+        
'36af4af4923df1bc513251aead09fea9aaa6b9cd64478129a228dba8b23aa490f7597520c0b4c483a68ed1bb65080599cdd19e36498ff0d6ba95c2c0e0bf73ea'
+        
'1f6d9ddf899a07126f20073457f6dec1f7f32e7785d5f9593169d2bda9674d2e2e385692df6c17b9d34038772d02cf0fed972bd6d3098447433324011fbe2acf'
+        
'8387a8189f53567f7a1541a7600f4d998d111721aba7ba6a1117afcaf0e7c33e6d07a1d899bf1b7120a61ea63c1fa30af42c57189d895a036ea3592496f98e32'
+        
'fa85f3ced5143524fac1d6403179052a520307e880902bddd0d239e580c6c2fe1368f6f78bad2950e2e06217e1fd318a52ef810b65e0870636006d87615c7e99'
+        
'1ea251abb358de7675012b9c9bc6a7187c4c171267f4466437e1d324c1a19ed6e8f5b2eeb625093cfa0303ea534f9d4cd900966338b18126a09a41b6a3939dfc')
+_names=(
+  AllRADecoder
+  BinauralDecoder
+  CoordinateConverter
+  DirectionalCompressor
+  DirectivityShaper
+  DistanceCompensator
+  DualDelay
+  EnergyVisualizer
+  FdnReverb
+  MatrixMultiplier
+  MultiBandCompressor
+  MultiEQ
+  MultiEncoder
+  OmniCompressor
+  ProbeDecoder
+  RoomEncoder
+  SceneRotator
+  SimpleDecoder
+  StereoEncoder
+  ToolBox
+)
 
 prepare() {
-  mv -v "${_name}-v$pkgver" "$pkgname-$pkgver"
-  cd "$pkgname-$pkgver"
+  local name
+
   declare -A comments=(
     ['AllRADecoder']="Design an Ambisonic decoder for an arbitrary loudspeaker 
layout using the AllRAD approach."
     ['BinauralDecoder']="Renders the Ambisonic input signal to a binaural 
headphone signal using the MagLS approach."
@@ -74,58 +103,50 @@
     ['StereoEncoder']="Ambisonic Encoder"
     ['ToolBox']="Ambisonic Transformation"
   )
-  for name in "${_standalones[@]}"; do
+  for name in "${_names[@]}"; do
     gendesk -n \
-            --pkgname "at.iem.plugins.${name}" \
-            --name "${name}" \
-            --exec "${name}" \
-            --icon "${pkgname}" \
+            --pkgname at.iem.plugins.$name \
+            --name $name \
+            --exec $name \
+            --icon $pkgname \
             --pkgdesc "${comments[$name]}" \
             --genericname "${generic[$name]}" \
-            --categories "${pkgname}"
+            --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"
+  # fix for juce >= 7.0.2 compatibility: 
https://gitlab.com/iem.at/IEMPluginSuite/-/merge_requests/2
+  patch -Np1 -d $_name-v$pkgver -i ../$pkgname-1.13.0-juce7.patch
+  # build against system juce: 
https://gitlab.com/iem.at/IEMPluginSuite/-/merge_requests/1
+  patch -Np1 -d $_name-v$pkgver -i ../$pkgname-1.13.0-system_juce.patch
+  # remove unnecessary dependencies
+  patch -Np1 -d $_name-v$pkgver -i ../$pkgname-1.13.0-remove_deps.patch
 }
 
 build() {
-  cd "$pkgname-$pkgver"
-
-  for _jucer in */*.jucer; do
-    _name="$(dirname ${_jucer})"
-    ln -sv ../resources/ "${_name}/"
-    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"
-
-    # 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
+  cmake \
+    -B build \
+    -S $_name-v$pkgver \
+    -DCMAKE_BUILD_TYPE=None \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DIEM_BUILD_STANDALONE=ON \
+    -DIEM_USE_SYSTEM_JUCE=ON \
+    -Wno-dev
+  cmake --build build
 }
 
 package() {
-  depends+=('libasound.so' 'libcurl.so' 'libFLAC.so' 'libfftw3f.so'
-  'libfreetype.so' 'libjack.so' 'libjpeg.so' 'libogg.so' 'libvorbis.so'
-  'libvorbisenc.so' 'libvorbisfile.so')
+  local name
 
-  cd "$pkgname-$pkgver"
-  for _jucer in */*.jucer; do
-    _name="$(dirname "${_jucer}")"
-    install -vDm 755 "${_name}/Builds/LinuxMakefile/build/${_name##_}" \
-      -t "${pkgdir}/usr/bin"
-    install -vDm 755 "${_name}/Builds/LinuxMakefile/build/${_name##_}.so" \
-      -t "${pkgdir}/usr/lib/vst"
+  depends+=(libasound.so libcurl.so libfftw3f.so libfreetype.so libjack.so
+  libjpeg.so)
+
+  for name in "${_names[@]}"; do
+    install -vDm 755 build/$name/${name}_artefacts/None/Standalone/$name -t 
"$pkgdir/usr/bin/"
+    install -vDm 755 
build/$name/${name}_artefacts/None/VST3/$name.vst3/Contents/$CARCH-linux/$name.so
 -t "$pkgdir/usr/lib/vst3/$name.vst3/Contents/$CARCH-linux/"
   done
 
-  # XDG desktop integration
-  install -vDm 644 *.desktop -t "${pkgdir}/usr/share/applications"
-  install -vDm 644 "../${pkgname}.menu" \
-    -t "${pkgdir}/etc/xdg/menus/applications-merged/"
-  install -vDm 644 "../${pkgname}.directory" \
-    -t "${pkgdir}/usr/share/desktop-directories/"
-  install -vDm 644 {ChangeLog,README}.md -t 
"${pkgdir}/usr/share/doc/${pkgname}"
+  install -vDm 644 *.desktop -t "$pkgdir/usr/share/applications/"
+  install -vDm 644 $pkgname.menu -t 
"$pkgdir/etc/xdg/menus/applications-merged/"
+  install -vDm 644 $pkgname.directory -t 
"$pkgdir/usr/share/desktop-directories/"
+  install -vDm 644 $_name-v$pkgver/{ChangeLog,README}.md -t 
"$pkgdir/usr/share/doc/$pkgname/"
 }

Deleted: iempluginsuite-1.12.0-juce_gl.patch
===================================================================
--- iempluginsuite-1.12.0-juce_gl.patch 2022-09-15 18:04:17 UTC (rev 1302872)
+++ iempluginsuite-1.12.0-juce_gl.patch 2022-09-15 18:33:47 UTC (rev 1302873)
@@ -1,396 +0,0 @@
-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);
- 

Reply via email to