/* ============================================================================== FilterView.h Created: 16 Jan 2026 5:06:31pm Author: esca ============================================================================== */ #pragma once #include "juce_gui_basics/juce_gui_basics.h" #include "juce_opengl/juce_opengl.h" #include #include "OpenGLUtils.h" #include #define CRUSHVIEW_SAMPLECOUNT 200 #define VERTEXSHADERFILTERFILL R"(placeholder)" #define FRAGSHADERFILTERFILL R"(placeholder)" #define VERTEXSHADERFILTER R"(placeholder)" #define FRAGSHADERFILTER R"(placeholder)" class FilterView : public juce::Component, public juce::OpenGLRenderer { public: FilterView(); ~FilterView() override; void renderFilter(); void newOpenGLContextCreated() override; void renderOpenGL() override; void openGLContextClosing() override; void paint (juce::Graphics&) override; void resized() override; private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilterView) bool isLowPass; float cutoff; float mix; juce::OpenGLContext ctx; juce::OpenGLPixelFormat antialiasing; std::vector filterVertices; std::vector filterIndices; std::vector filterBackgroundVertices; std::vector filterBackgroundIndices; std::vector backgroundVertices; std::vector backgroundIndices; juce::ComponentListener listener; GLuint vboFilter; GLuint iboFilter; GLuint vboFilterFill; GLuint iboFilterFill; GLuint vboBackground; GLuint iboBackground; std::string vertexShaderFilter; std::string fragmentShaderFilter; std::string vertexShaderFilterFill; std::string fragmentShaderFilterFill; std::string vertexShaderBackground; std::string fragmentShaderBackground; std::unique_ptr shaderProgramFilter; std::unique_ptr shaderProgramFilterFill; std::unique_ptr shaderProgramBackground; juce::Image background; juce::OpenGLTexture bgTexture; };