1818 This component lives inside our window, and this is where you should put all
1919 your controls and content.
2020*/
21- class GLSLComponent : public OpenGLAppComponent ,
22- public AsyncUpdater
21+ class GLSLComponent : public OpenGLAppComponent ,
22+ public AsyncUpdater
2323{
2424public:
2525 // ==============================================================================
26- GLSLComponent ();
27- ~GLSLComponent ();
26+ GLSLComponent ();
27+ ~GLSLComponent ();
2828
2929 // ==============================================================================
30- void initialise () override ;
31- void shutdown () override ;
32- void render () override ;
30+ void initialise () override ;
31+ void shutdown () override ;
32+ void render () override ;
3333
3434 // ==============================================================================
35- void paint (Graphics& g) override ;
36- void resized () override ;
35+ void paint (Graphics& g) override ;
36+ void resized () override ;
3737
3838 // ==============================================================================
39- void setStatusLabelPtr (Label* _statusLabel);
40- void setFragmentDocPtr (CodeDocument* _fragmentDoc);
39+ void setStatusLabelPtr (Label* _statusLabel);
40+ void setFragmentDocPtr (CodeDocument* _fragmentDoc);
4141
4242 // ==============================================================================
43- void setShaderProgram (const String& vertexShader, const String& fragmentShader);
44- void setShaderProgramFragment (const String& _fragmentShader);
45- void setShaderProgramVertex (const String& _vertexShader);
43+ void setShaderProgram (const String& vertexShader, const String& fragmentShader);
44+ void setShaderProgramFragment (const String& _fragmentShader);
45+ void setShaderProgramVertex (const String& _vertexShader);
4646
4747 // ==============================================================================
48- void setMidiCCValue (int ccNumber, float value);
49- void setSpectrumValue (int spectrumNumber, float value);
50- void setWaveValue (int waveNumber, float value);
48+ void setMidiCCValue (int ccNumber, float value);
49+ void setSpectrumValue (int spectrumNumber, float value);
50+ void setWaveValue (int waveNumber, float value);
5151
5252 // ==============================================================================
53- bool isInitialised = false ;
54- bool isShaderCompileSuccess = false ;
53+ bool isInitialised = false ;
54+ bool isShaderCompileSuccess = false ;
5555
5656 static const String defaultVertexShader;
5757 static const String defaultFragmentShader;
@@ -60,36 +60,36 @@ class GLSLComponent : public OpenGLAppComponent,
6060 // ==============================================================================
6161 virtual void handleAsyncUpdate () override ;
6262
63- // ==============================================================================
64- void createShaders ();
65- void updateShader ();
66- void mouseDrag (const MouseEvent& event) override ;
63+ // ==============================================================================
64+ void createShaders ();
65+ void updateShader ();
66+ void mouseDrag (const MouseEvent& event) override ;
6767
6868 // ==============================================================================
69- Matrix3D<float > getProjectionMatrix () const ;
70- Matrix3D<float > getViewMatrix () const ;
71-
69+ Matrix3D<float > getProjectionMatrix () const ;
70+ Matrix3D<float > getViewMatrix () const ;
71+
7272 // ==============================================================================
7373 String vertexShader;
7474 String fragmentShader;
7575
76- String statusText{};
77- Label* statusLabel = nullptr ;
78- CodeDocument* fragmentDoc = nullptr ;
76+ String statusText {};
77+ Label* statusLabel = nullptr ;
78+ CodeDocument* fragmentDoc = nullptr ;
7979
8080 std::unique_ptr<OpenGLShaderProgram> shader;
8181 std::unique_ptr<Shape> shape;
8282 std::unique_ptr<Attributes> attributes;
8383 std::unique_ptr<Uniforms> uniforms;
8484
85- GLfloat timeCounter = 0 .0f ;
85+ GLfloat timeCounter = 0 .0f ;
8686
8787 String newVertexShader, newFragmentShader;
88- bool isShaderCompileReady = false ;
89- float mouseX, mouseY;
90- float m_midiCC[128 ] = {0 };
91- float m_spectrum[256 ] = {0 };
92- float m_wave[256 ] = {0 };
88+ bool isShaderCompileReady = false ;
89+ float mouseX, mouseY;
90+ float m_midiCC[128 ] = { 0 };
91+ float m_spectrum[256 ] = { 0 };
92+ float m_wave[256 ] = { 0 };
9393
94- JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GLSLComponent)
94+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GLSLComponent)
9595};
0 commit comments