I would like to add an OpenGl canvas to the JuceAudioPlugin project. Right now I’m trying to port the OpenGl
demo from the JUCE demo directly. One thing that confuses me is that the OpenGlDemo class is written in a single cpp-file
and not partitioned in a header and a cpp file. I can get the canvas to “work” when I create the class using the *.h and *.cpp
files. When I try to instantiate the OpenGlDemo using the “one-file-approach” I get the following errors:
c:\jucedevel\juceaudioplugin\demo\src\DemoEditorComponent.h(86) : error C2143: syntax error : missing ';' before '*'
c:\jucedevel\juceaudioplugin\demo\src\DemoEditorComponent.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\jucedevel\juceaudioplugin\demo\src\DemoEditorComponent.h(86) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
..\..\src\DemoEditorComponent.cpp(76) : error C2065: 'gl' : undeclared identifier
..\..\src\DemoEditorComponent.cpp(76) : error C2061: syntax error : identifier 'createOpenGLDemo'
line 86 refers to the declaration of the OpenGlDemo pointer which reads:
which I use in the DemoEditComponent.cpp as such :
Can anyone please tell me what the problem is (I hope I’m not missing any information here )
Also, I’m instantiating the OpenGlDemo in the DemoEditorComponent.cpp (which I believe is correct) but how does the compiler
know where to look when I cannot include the class-cpp file (I’m only used to including header files)? Really curious to know the answer
Hope to get some answers - and that I have made myself clear
Cheers