diff --git a/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/Info.plist b/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/Info.plist index ade064b48d..8716152a7e 100644 --- a/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/Info.plist +++ b/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 13F34 + 14A389 CFBundleExecutable AnimationAppExample CFBundleIdentifier @@ -21,17 +21,17 @@ DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 6A317 + 6A1052d DTPlatformVersion GM DTSDKBuild - 13F26 + 14A382 DTSDKName - macosx10.9 + macosx10.10 DTXcode - 0600 + 0610 DTXcodeBuild - 6A317 + 6A1052d NSHighResolutionCapable NSHumanReadableCopyright diff --git a/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/MacOS/AnimationAppExample b/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/MacOS/AnimationAppExample index 7df9d4e5dc..aeb45da05b 100755 Binary files a/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/MacOS/AnimationAppExample and b/examples/AnimationAppExample/Builds/MacOSX/build/Debug/AnimationAppExample.app/Contents/MacOS/AnimationAppExample differ diff --git a/examples/AnimationAppExample/Source/MainComponent.cpp b/examples/AnimationAppExample/Source/MainComponent.cpp index d278cb303a..9b64b48ad1 100644 --- a/examples/AnimationAppExample/Source/MainComponent.cpp +++ b/examples/AnimationAppExample/Source/MainComponent.cpp @@ -20,56 +20,45 @@ class MainContentComponent : public AnimatedAppComponent { public: //============================================================================== - - MainContentComponent() { setSize (500, 400); setFramesPerSecond (60); } - ~MainContentComponent() + void update() override { + // This function is called at the frequency specified by the setFramesPerSecond() call + // in the constructor. You can use it to update counters, animate values, etc. } - void update() + void paint (Graphics& g) override { - - } - - void paint (Graphics& g) - { - // fill background + // (Our component is opaque, so we must completely fill the background with a solid colour) g.fillAll (Colours::black); - int fishLength = 15; - - // set the drawing colour g.setColour (Colours::white); + const int fishLength = 15; - // Create a new path object for the spine - Path p; + Path spinePath; - // for (int i = 0; i < fishLength; ++i) { - float radius = 100 + 10 * sin (getFrameCounter() * 0.1 + i * 0.5f); - float x = getWidth()/2 + 1.5f * radius * sin (getFrameCounter() * 0.02f + i * 0.12f); - float y = getHeight()/2 + radius * cos (getFrameCounter() * 0.04f + i * 0.12f); + const float radius = 100 + 10 * std::sin (getFrameCounter() * 0.1f + i * 0.5f); + const float x = getWidth() / 2.0f + 1.5f * radius * std::sin (getFrameCounter() * 0.02f + i * 0.12f); + const float y = getHeight() / 2.0f + radius * std::cos (getFrameCounter() * 0.04f + i * 0.12f); - // draw the ellipses of the fish - g.fillEllipse(x - i, y - i, 2 + 2*i, 2 + 2*i); + // draw the circles along the fish + g.fillEllipse (x - i, y - i, 2.0f + 2.0f * i, 2.0f + 2.0f * i); - // start a new path at the beginning otherwise add the next point if (i == 0) - p.startNewSubPath(x, y); + spinePath.startNewSubPath (x, y); // if this is the first point, start a new path.. else - p.lineTo (x, y); + spinePath.lineTo (x, y); // ...otherwise add the next point } - // stroke the path that we have created - g.strokePath (p, PathStrokeType (4)); - + // draw an outline around the path that we have created + g.strokePath (spinePath, PathStrokeType (4)); } void resized() @@ -83,16 +72,15 @@ public: private: //============================================================================== - // private member variables - - - + // Your private member variables go here... JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainContentComponent) }; -Component* createMainContentComponent() { return new MainContentComponent(); }; +// (This function is called by the app startup code to create our main component) +Component* createMainContentComponent() { return new MainContentComponent(); } + #endif // MAINCOMPONENT_H_INCLUDED diff --git a/extras/Introjucer/Source/BinaryData/jucer_AnimatedComponentTemplate.cpp b/extras/Introjucer/Source/BinaryData/jucer_AnimatedComponentTemplate.cpp index da410ff393..f405f4a008 100644 --- a/extras/Introjucer/Source/BinaryData/jucer_AnimatedComponentTemplate.cpp +++ b/extras/Introjucer/Source/BinaryData/jucer_AnimatedComponentTemplate.cpp @@ -33,7 +33,7 @@ public: void update() override { // This function is called at the frequency specified by the setFramesPerSecond() call - // in the constructor. You can use it + // in the constructor. You can use it to update counters, animate values, etc. } void paint (Graphics& g) override diff --git a/extras/Introjucer/Source/BinaryData/jucer_OpenglComponentTemplate.cpp b/extras/Introjucer/Source/BinaryData/jucer_OpenglComponentTemplate.cpp index 88eef810b5..d98bd07e55 100644 --- a/extras/Introjucer/Source/BinaryData/jucer_OpenglComponentTemplate.cpp +++ b/extras/Introjucer/Source/BinaryData/jucer_OpenglComponentTemplate.cpp @@ -23,7 +23,6 @@ public: MainContentComponent() { setSize (500, 400); - } ~MainContentComponent() diff --git a/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_AudioApp.h b/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_AudioApp.h index c0cc449e24..ace6983a9a 100644 --- a/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_AudioApp.h +++ b/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_AudioApp.h @@ -33,7 +33,7 @@ struct AudioAppWizard : public NewProjectWizard bool initialiseProject (Project& project) override { - createSourceFolder(); + createSourceFolder(); File mainCppFile = getSourceFilesFolder().getChildFile ("Main.cpp"); File contentCompCpp = getSourceFilesFolder().getChildFile ("MainComponent.cpp"); diff --git a/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_openGL.h b/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_openGL.h index fd7a89e06f..3018942cbe 100644 --- a/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_openGL.h +++ b/extras/Introjucer/Source/Wizards/jucer_ProjectWizard_openGL.h @@ -31,9 +31,9 @@ struct OpenGLAppWizard : public NewProjectWizard String getDescription() const override { return TRANS("Creates a blank JUCE application with a single window component. This component supports openGL drawing features including 3D model import and GLSL shaders."); } const char* getIcon() const override { return BinaryData::wizard_OpenGL_svg; } - bool initialiseProject (Project& project) override + bool initialiseProject (Project& project) override { - createSourceFolder(); + createSourceFolder(); File mainCppFile = getSourceFilesFolder().getChildFile ("Main.cpp"); File contentCompCpp = getSourceFilesFolder().getChildFile ("MainComponent.cpp"); @@ -51,7 +51,7 @@ struct OpenGLAppWizard : public NewProjectWizard // create main window String windowCpp = project.getFileTemplate ("jucer_OpenglComponentTemplate_cpp") -.replace ("INCLUDE_JUCE", CodeHelpers::createIncludeStatement (project.getAppIncludeFile(), contentCompCpp), false); + .replace ("INCLUDE_JUCE", CodeHelpers::createIncludeStatement (project.getAppIncludeFile(), contentCompCpp), false); if (! FileHelpers::overwriteFileWithNewDataIfDifferent (contentCompCpp, windowCpp)) failedFiles.add (contentCompCpp.getFullPathName()); @@ -72,7 +72,6 @@ struct OpenGLAppWizard : public NewProjectWizard sourceGroup.addFile (mainCppFile, -1, true); - return true; } };