Skip to content

Commit

Permalink
examples: Update opengl basic to newset JUCE
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed May 2, 2020
1 parent 4419bd1 commit 2b8b13e
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 71 deletions.
28 changes: 14 additions & 14 deletions examples/opengl/opengl-basic/Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@
==============================================================================
*/

#include "../JuceLibraryCode/JuceHeader.h"
#include "JuceHeader.h"
#include "MainComponent.hpp"

//==============================================================================
class basicopenglApplication : public JUCEApplication
class basicopenglApplication : public juce::JUCEApplication
{
public:
//==============================================================================
basicopenglApplication() {}
basicopenglApplication() { }

const String getApplicationName() override { return ProjectInfo::projectName; }
const String getApplicationVersion() override { return ProjectInfo::versionString; }
const juce::String getApplicationName() override { return ProjectInfo::projectName; }
const juce::String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; }

//==============================================================================
void initialise(const String& commandLine) override
void initialise(const juce::String& commandLine) override
{
// This method is where you should put your application's initialisation
// code..
Expand All @@ -47,7 +47,7 @@ class basicopenglApplication : public JUCEApplication
quit();
}

void anotherInstanceStarted(const String& commandLine) override
void anotherInstanceStarted(const juce::String& commandLine) override
{
// When another instance of the app is launched while this one is
// running, this method is invoked, and the commandLine parameter tells
Expand All @@ -59,14 +59,14 @@ class basicopenglApplication : public JUCEApplication
This class implements the desktop window that contains an instance of
our MainComponent class.
*/
class MainWindow : public DocumentWindow
class MainWindow : public juce::DocumentWindow
{
public:
MainWindow(String name)
: DocumentWindow(
"tobanteAudio: OpenGL - Basic",
Desktop::getInstance().getDefaultLookAndFeel().findColour(ResizableWindow::backgroundColourId),
DocumentWindow::allButtons)
MainWindow(juce::String name)
: DocumentWindow("tobanteAudio: OpenGL - Basic",
juce::Desktop::getInstance().getDefaultLookAndFeel().findColour(
juce::ResizableWindow::backgroundColourId),
juce::DocumentWindow::allButtons)
{
ignoreUnused(name);
setUsingNativeTitleBar(true);
Expand All @@ -87,7 +87,7 @@ class basicopenglApplication : public JUCEApplication
// This is called when the user tries to close this window. Here,
// we'll just ask the app to quit when this happens, but you can
// change this to do whatever you need.
JUCEApplication::getInstance()->systemRequestedQuit();
juce::JUCEApplication::getInstance()->systemRequestedQuit();
}

/* Note: Be careful if you override any DocumentWindow methods - the
Expand Down
4 changes: 2 additions & 2 deletions examples/opengl/opengl-basic/Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void MainComponent::shutdown()
void MainComponent::render()
{
// This clears the context with a black background.
OpenGLHelpers::clear(Colours::green);
juce::OpenGLHelpers::clear(juce::Colours::green);

// Points in 3D space
GLfloat verts[] {-1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f};
Expand All @@ -56,7 +56,7 @@ void MainComponent::render()
}

//==============================================================================
void MainComponent::paint(Graphics& g)
void MainComponent::paint(juce::Graphics& g)
{
// You can add your component specific drawing code here!
// This will draw over the top of the openGL background.
Expand Down
7 changes: 3 additions & 4 deletions examples/opengl/opengl-basic/Source/MainComponent.hpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
#pragma once

#include "../JuceLibraryCode/JuceHeader.h"
#include "JuceHeader.h"

//==============================================================================
/*
This component lives inside our window, and this is where you should put all
your controls and content.
*/
class MainComponent : public OpenGLAppComponent
class MainComponent : public juce::OpenGLAppComponent
{
public:
//==============================================================================
MainComponent();
~MainComponent();

//==============================================================================
void initialise() override;
void shutdown() override;
void render() override;

//==============================================================================
void paint(Graphics& g) override;
void paint(juce::Graphics& g) override;
void resized() override;

private:
Expand Down
144 changes: 93 additions & 51 deletions examples/opengl/opengl-basic/opengl-basic.jucer
Original file line number Diff line number Diff line change
@@ -1,51 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="Amrf3h" name="opengl-basic" projectType="guiapp" jucerVersion="5.4.3">
<MAINGROUP id="QstgHE" name="opengl-basic">
<GROUP id="{808FA82E-AC2F-EBB4-AD3D-954E3D74B205}" name="Source">
<FILE id="i7lfJJ" name="MainComponent.hpp" compile="0" resource="0" file="Source/MainComponent.hpp"/>
<FILE id="eH1cgS" name="MainComponent.cpp" compile="1" resource="0" file="Source/MainComponent.cpp"/>
<FILE id="ZEUI2T" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
</GROUP>
</MAINGROUP>
<EXPORTFORMATS>
<VS2017 targetFolder="Builds/VisualStudio2017">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_audio_basics" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_core" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../../../lib/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../../../lib/JUCE/modules"/>
</MODULEPATHS>
</VS2017>
</EXPORTFORMATS>
<MODULES>
<MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_formats" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_cryptography" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
</MODULES>
<LIVE_SETTINGS>
<WINDOWS/>
</LIVE_SETTINGS>
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1"/>
</JUCERPROJECT>
<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="mI3ltG" name="opengl-basic" projectType="guiapp" useAppConfig="0"
addUsingNamespaceToJuceHeader="0" displaySplashScreen="1">
<MAINGROUP id="h4b78j" name="opengl-basic">
<GROUP id="{4FD9F18F-7E9D-3223-A3F4-5A1BEEF615A6}" name="Source">
<FILE id="pRI9Px" name="MainComponent.h" compile="0" resource="0" file="Source/MainComponent.h"/>
<FILE id="qUGRAn" name="MainComponent.cpp" compile="1" resource="0"
file="Source/MainComponent.cpp"/>
<FILE id="GoYLkS" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
</GROUP>
</MAINGROUP>
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_audio_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_core" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../.builds/JUCE/modules"/>
</MODULEPATHS>
</XCODE_MAC>
<VS2019 targetFolder="Builds/VisualStudio2019">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_audio_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_core" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../.builds/JUCE/modules"/>
</MODULEPATHS>
</VS2019>
<LINUX_MAKE targetFolder="Builds/LinuxMakefile">
<CONFIGURATIONS>
<CONFIGURATION isDebug="1" name="Debug"/>
<CONFIGURATION isDebug="0" name="Release"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_audio_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_core" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_cryptography" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_events" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../../.builds/JUCE/modules"/>
<MODULEPATH id="juce_opengl" path="../../.builds/JUCE/modules"/>
</MODULEPATHS>
</LINUX_MAKE>
</EXPORTFORMATS>
<JUCEOPTIONS JUCE_STRICT_REFCOUNTEDPOINTER="1"/>
<MODULES>
<MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_formats" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_cryptography" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
</MODULES>
<LIVE_SETTINGS>
<LINUX/>
</LIVE_SETTINGS>
</JUCERPROJECT>

0 comments on commit 2b8b13e

Please sign in to comment.