/* ============================================================================== This is an automatically generated GUI class created by the Projucer! Be careful when adding custom code to these files, as only the code within the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded and re-saved. Created with Projucer version: 4.3.0 ------------------------------------------------------------------------------ The Projucer is part of the JUCE library - "Jules' Utility Class Extensions" Copyright (c) 2015 - ROLI Ltd. ============================================================================== */ //[Headers] You can add your own extra header files here... #ifdef WIN32 # define NOMINMAX # include # include #else # include #endif /* WIN32 */ //[/Headers] #include "MainComponent.h" //[MiscUserDefs] You can add your own user definitions and misc code here... //[/MiscUserDefs] //============================================================================== MainComponent::MainComponent (AudioProcessor* processor) : AudioProcessorEditor(processor) { //[Constructor_pre] You can add your own custom stuff here.. //[/Constructor_pre] addAndMakeVisible (pauseButton = new TextButton ("new button")); pauseButton->setButtonText (TRANS("pause")); pauseButton->addListener (this); //[UserPreSize] glContext.setComponentPaintingEnabled(true); // either (1) makes input sluggy glContext.setContinuousRepainting(true); // or (2) uneven refresh //startTimerHz(60); glContext.setRenderer(this); glContext.attachTo(*this); //[/UserPreSize] setSize (600, 400); //[Constructor] You can add your own custom stuff here.. pauseButton->setClickingTogglesState(true); //[/Constructor] } MainComponent::~MainComponent() { //[Destructor_pre]. You can add your own custom destruction code here.. //[/Destructor_pre] pauseButton = nullptr; //[Destructor]. You can add your own custom destruction code here.. //[/Destructor] } //============================================================================== void MainComponent::paint (Graphics& g) { //[UserPrePaint] Add your own custom painting code here.. //[/UserPrePaint] //[UserPaint] Add your own custom painting code here.. //[/UserPaint] } void MainComponent::resized() { //[UserPreResize] Add your own custom resize code here.. //[/UserPreResize] pauseButton->setBounds (8, 8, 128, 24); //[UserResized] Add your own custom resize handling here.. //[/UserResized] } void MainComponent::buttonClicked (Button* buttonThatWasClicked) { //[UserbuttonClicked_Pre] //[/UserbuttonClicked_Pre] if (buttonThatWasClicked == pauseButton) { //[UserButtonCode_pauseButton] -- add your button handler code here.. //[/UserButtonCode_pauseButton] } //[UserbuttonClicked_Post] //[/UserbuttonClicked_Post] } //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... void MainComponent::renderOpenGL() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix glOrtho(0, 1, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glLoadIdentity(); if(!pauseButton->getToggleState()) { glTranslatef( std::fmod(Time::getMillisecondCounterHiRes()/1000, 1), 0, 0 ); } glColor4f(1,1,1,1); glBegin(GL_LINES); glVertex2f(0,-1); glVertex2f(0, 1); glEnd(); } void MainComponent::newOpenGLContextCreated() { } void MainComponent::openGLContextClosing() { } void MainComponent::timerCallback() { glContext.triggerRepaint(); } //[/MiscUserCode] //============================================================================== #if 0 /* -- Projucer information section -- This is where the Projucer stores the metadata that describe this GUI layout, so make changes in here at your peril! BEGIN_JUCER_METADATA END_JUCER_METADATA */ #endif //[EndFile] You can add extra defines here... //[/EndFile]