-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved duplicated qglwidget calls to wglwidget methods (this prepares …
…for adding an alternative implementation using qopenglwindow) and use directconnection where appropriate
- Loading branch information
Showing
16 changed files
with
93 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
#include <QWindow> | ||
|
||
#include "waveform/sharedglcontext.h" | ||
#include "widget/wglwidget.h" | ||
|
||
WGLWidget::WGLWidget(QWidget* parent) | ||
: QGLWidget(parent, SharedGLContext::getWidget()) { | ||
setAttribute(Qt::WA_NoSystemBackground); | ||
setAttribute(Qt::WA_OpaquePaintEvent); | ||
setAutoFillBackground(false); | ||
setAutoBufferSwap(false); | ||
// Not interested in repaint or update calls, as we draw from the vsync thread | ||
setUpdatesEnabled(false); | ||
} | ||
|
||
bool WGLWidget::isContextValid() const { | ||
return context()->isValid(); | ||
} | ||
|
||
bool WGLWidget::isContextSharing() const { | ||
return context()->isSharing(); | ||
} | ||
|
||
bool WGLWidget::shouldRender() const { | ||
return true; | ||
return isValid() && isVisible() && windowHandle() && windowHandle()->isExposed(); | ||
} | ||
|
||
void WGLWidget::makeCurrentIfNeeded() { | ||
// TODO m0dB is this really needed? is calling makeCurrent without this 'if' really a problem? | ||
//if (context() != QGLContext::currentContext()) { | ||
makeCurrent(); | ||
//} | ||
} |
Oops, something went wrong.