Skip to content

Commit

Permalink
Add glPhysicalWindowHasBeenResized() SLOT
Browse files Browse the repository at this point in the history
  • Loading branch information
hmartinez82 committed Oct 14, 2023
1 parent 4c66061 commit 491aa73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/core/StelApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ void StelApp::draw()
}

/*************************************************************************
Call this when the size of the GL window has changed
Call this when the virtual size of the GL window has changed
*************************************************************************/
void StelApp::glWindowHasBeenResized(const QRectF& rect)
{
Expand All @@ -1091,6 +1091,17 @@ void StelApp::glWindowHasBeenResized(const QRectF& rect)
#endif
}

/*************************************************************************
Call this when the physical size of the GL window has changed
*************************************************************************/
void StelApp::glPhysicalWindowHasBeenResized(const QRectF& rect)
{
#ifdef ENABLE_SPOUT
if (spoutSender)
spoutSender->resize(static_cast<uint>(rect.width()),static_cast<uint>(rect.height()));
#endif
}

// Handle mouse clics
void StelApp::handleClick(QMouseEvent* inputEvent)
{
Expand Down
5 changes: 4 additions & 1 deletion src/core/StelApp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,12 @@ class StelApp : public QObject
///////////////////////////////////////////////////////////////////////////
// Scriptable methods
public slots:
//! Call this when the size of the GL window has changed.
//! Call this when the virtual size of the GL window has changed.
void glWindowHasBeenResized(const QRectF &rect);

//! Call this when the physical size of the GL window has changed.
void glPhysicalWindowHasBeenResized(const QRectF &rect);

//! Set flag for activating night vision mode.
void setVisionModeNight(bool);
//! Get flag for activating night vision mode.
Expand Down

0 comments on commit 491aa73

Please sign in to comment.