I am trying to render data in an entire DocumentWindow, but am unable to properly achieve it. The rendered data appears in the lower, left part of the window and is always the same portion of the window in both x- and y-direction. I have a custom class for the DocumentWindow and an OpenGLAppComponent to render to. I have tried to resize things to my best knowledge, but I cannot get it to work. What am I doing wrong? I am on a 4k screen, but that should not matter.
Here are the relevant parts from the cpp files. I have bolded the things that might be of interest. Please let me know if you need anything else.
QAWindow.cpp (relevant parts only). I do nothing to DocumentWindow::resized().
QAWindow::QAWindow(const int& width, const int& height, QAHandler* qaHandler, const QARun& qaRun, const unsigned int& compositeIndex) : DocumentWindow(qaRun.QAComposites[compositeIndex]["QACompositeName"], Colours::lightgrey, DocumentWindow::allButtons), markedForDeletion(false), mQAView(nullptr) { setFullScreen(true); setUsingNativeTitleBar(true); mQAView = juce::ScopedPointer<QAView>(new QAView(getWidth(), getHeight(), this, qaHandler, qaRun, compositeIndex)); setContentOwned(mQAView, true); setResizable(true, true); centreWithSize(getWidth(), getHeight()); setVisible(true); }
QAView.cpp
QAView::QAView(const int& width, const int& height, QAWindow* qaWindow, QAHandler* qaHandler, const QARun& qaRun, const unsigned int& compositeIndex) : mQAWindow(qaWindow, false), mQAHandler(qaHandler, false), mQASettings(qaRun.QASettings), mQACaseState(ReadyForNextCase), mQACompositeName(qaRun.getQACompositeName(compositeIndex)), mQACompositeCommands(qaRun.getQACompositeCommands(compositeIndex)), mQACases(qaRun.getQACaseDeque()), mInitialized(false) { setSize(width, height); } QAView::~QAView() { shutdownOpenGL(); } // initialise() is called on OpenGL context creation. void QAView::initialise() { std::string out; myVR::initialize(juce::JSON::toString(mQASettings).toStdString(), this); mQACompositeId = myVR::createComposite(); LOGQAi("Create composite with id %i.", mQACompositeId); myVR::execute(mQACompositeId, juce::JSON::toString(mQACompositeCommands).toStdString(), out); myVR::setCompositeWindow(mQACompositeId, 0, 0, mQAWindow->getWidth(), mQAWindow->getHeight()); mInitialized = true; } // Called on OpenGL context closing. void QAView::shutdown() { } void QAView::render() { if (mInitialized) { myVR::render(mQACompositeId); runCases(); } } void QAView::paint(Graphics& g) { } void QAView::resized() { myVR::setCompositeWindow(mQACompositeId, 0, 0, mQAWindow->getWidth(), mQAWindow->getHeight()); }
Here is an image describing the situation:
After resizing/squashing the window, this is the result: