Fix QOpenGL warning

This commit is contained in:
Atlante45 2015-12-07 08:37:07 -08:00
parent 18198cb6fb
commit f8ee377f01
3 changed files with 9 additions and 3 deletions

View file

@ -45,7 +45,7 @@
#include <QtNetwork/QNetworkDiskCache>
#include <gl/Config.h>
#include <QtGui/QOpenGLContext>
#include <QOpenGLContextWrapper.h>
#include <AccountManager.h>
#include <AddressManager.h>
@ -1397,13 +1397,13 @@ void Application::paintGL() {
_lockedFramebufferMap[finalTexture] = scratchFramebuffer;
uint64_t displayStart = usecTimestampNow();
Q_ASSERT(QOpenGLContext::currentContext() == _offscreenContext->getContext());
Q_ASSERT(isCurrentContext(_offscreenContext->getContext()));
{
PROFILE_RANGE(__FUNCTION__ "/pluginSubmitScene");
PerformanceTimer perfTimer("pluginSubmitScene");
displayPlugin->submitSceneTexture(_frameCount, finalTexture, toGlm(size));
}
Q_ASSERT(QOpenGLContext::currentContext() == _offscreenContext->getContext());
Q_ASSERT(isCurrentContext(_offscreenContext->getContext()));
uint64_t displayEnd = usecTimestampNow();
const float displayPeriodUsec = (float)(displayEnd - displayStart); // usecs

View file

@ -37,4 +37,8 @@ bool QOpenGLContextWrapper::makeCurrent(QSurface* surface) {
void QOpenGLContextWrapper::doneCurrent() {
_context->doneCurrent();
}
bool isCurrentContext(QOpenGLContext* context) {
return QOpenGLContext::currentContext() == context;
}

View file

@ -30,4 +30,6 @@ private:
QOpenGLContext* _context { nullptr };
};
bool isCurrentContext(QOpenGLContext* context);
#endif // hifi_QOpenGLContextWrapper_h