mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-24 22:09:10 -06:00
- Correctly detect isRegularRendering flag
- Render GUI in the PostDraw function in order render it not on the cubefaces Closes #259
This commit is contained in:
@@ -120,11 +120,14 @@ OnScreenGUIModule::OnScreenGUIModule()
|
||||
);
|
||||
|
||||
OsEng.registerModuleCallback(
|
||||
OpenSpaceEngine::CallbackOption::Render,
|
||||
// This is done in the PostDraw phase so that it will render it on top of
|
||||
// everything else in the case of fisheyes. With this being in the Render callback
|
||||
// the GUI would be rendered on top of each of the cube faces
|
||||
OpenSpaceEngine::CallbackOption::PostDraw,
|
||||
[](){
|
||||
WindowWrapper& wrapper = OsEng.windowWrapper();
|
||||
bool showGui = wrapper.hasGuiWindow() ? wrapper.isGuiWindow() : true;
|
||||
if (wrapper.isMaster() && wrapper.isRegularRendering() && showGui ) {
|
||||
if (wrapper.isMaster() && showGui ) {
|
||||
glm::vec2 mousePosition = wrapper.mousePosition();
|
||||
//glm::ivec2 drawBufferResolution = _windowWrapper->currentDrawBufferResolution();
|
||||
glm::ivec2 windowSize = wrapper.currentWindowSize();
|
||||
|
||||
@@ -156,13 +156,12 @@ int SGCTWindowWrapper::currentNumberOfAaSamples() const {
|
||||
}
|
||||
|
||||
bool SGCTWindowWrapper::isRegularRendering() const {
|
||||
// TODO: Needs to implement the nonlinear rendering check ---abock
|
||||
|
||||
// sgct::SGCTWindow* w = sgct::Engine::instance()->getCurrentWindowPtr();
|
||||
// !w->isUsingFisheyeRendering() does not exist anymore ---abock
|
||||
// if (_isMaster && !w->isUsingFisheyeRendering() && _console->isVisible()) {
|
||||
|
||||
return true;
|
||||
sgct::SGCTWindow* w = sgct::Engine::instance()->getCurrentWindowPtr();
|
||||
std::size_t nViewports = w->getNumberOfViewports();
|
||||
ghoul_assert(nViewports > 0, "At least one viewport must exist at this time");
|
||||
sgct_core::Viewport* vp = w->getViewport(0);
|
||||
sgct_core::NonLinearProjection* nlp = vp->getNonLinearProjectionPtr();
|
||||
return nlp == nullptr;
|
||||
}
|
||||
|
||||
bool SGCTWindowWrapper::hasGuiWindow() const {
|
||||
|
||||
Reference in New Issue
Block a user