mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 07:23:51 +02:00
Fixing case on gl surface format helper
This commit is contained in:
parent
0023c034c4
commit
cc80dfb9e1
7 changed files with 11 additions and 14 deletions
|
@ -5,7 +5,7 @@
|
||||||
#include <QtGui/QSurfaceFormat>
|
#include <QtGui/QSurfaceFormat>
|
||||||
#include <QtOpenGL/QGL>
|
#include <QtOpenGL/QGL>
|
||||||
|
|
||||||
const QSurfaceFormat& getDefaultOpenGlSurfaceFormat() {
|
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat() {
|
||||||
static QSurfaceFormat format;
|
static QSurfaceFormat format;
|
||||||
static std::once_flag once;
|
static std::once_flag once;
|
||||||
std::call_once(once, [] {
|
std::call_once(once, [] {
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
class QSurfaceFormat;
|
class QSurfaceFormat;
|
||||||
class QGLFormat;
|
class QGLFormat;
|
||||||
|
|
||||||
const QSurfaceFormat& getDefaultOpenGlSurfaceFormat();
|
const QSurfaceFormat& getDefaultOpenGLSurfaceFormat();
|
||||||
const QGLFormat& getDefaultGLFormat();
|
const QGLFormat& getDefaultGLFormat();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
//
|
//
|
||||||
// GLWidget.cpp
|
|
||||||
// interface/src
|
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 8/14/13.
|
// Created by Bradley Austin Davis on 2015/12/03
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
// Derived from interface/src/GLCanvas.cpp created by Stephen Birarda on 8/14/13.
|
||||||
|
// Copyright 2013-2015 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
//
|
//
|
||||||
// GLWidget.h
|
// Created by Bradley Austin Davis on 2015/12/03
|
||||||
// interface/src
|
// Derived from interface/src/GLCanvas.h created by Stephen Birarda on 8/14/13.
|
||||||
//
|
// Copyright 2013-2015 High Fidelity, Inc.
|
||||||
// Created by Stephen Birarda on 8/14/13.
|
|
||||||
// Copyright 2013 High Fidelity, Inc.
|
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "GLHelpers.h"
|
#include "GLHelpers.h"
|
||||||
|
|
||||||
void GLWindow::createContext(QOpenGLContext* shareContext) {
|
void GLWindow::createContext(QOpenGLContext* shareContext) {
|
||||||
createContext(getDefaultOpenGlSurfaceFormat(), shareContext);
|
createContext(getDefaultOpenGLSurfaceFormat(), shareContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLWindow::createContext(const QSurfaceFormat& format, QOpenGLContext* shareContext) {
|
void GLWindow::createContext(const QSurfaceFormat& format, QOpenGLContext* shareContext) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ void OffscreenGLCanvas::create(QOpenGLContext* sharedContext) {
|
||||||
sharedContext->doneCurrent();
|
sharedContext->doneCurrent();
|
||||||
_context->setShareContext(sharedContext);
|
_context->setShareContext(sharedContext);
|
||||||
}
|
}
|
||||||
_context->setFormat(getDefaultOpenGlSurfaceFormat());
|
_context->setFormat(getDefaultOpenGLSurfaceFormat());
|
||||||
_context->create();
|
_context->create();
|
||||||
|
|
||||||
_offscreenSurface->setFormat(_context->format());
|
_offscreenSurface->setFormat(_context->format());
|
||||||
|
|
|
@ -128,7 +128,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
QTestWindow() {
|
QTestWindow() {
|
||||||
setSurfaceType(QSurface::OpenGLSurface);
|
setSurfaceType(QSurface::OpenGLSurface);
|
||||||
QSurfaceFormat format = getDefaultOpenGlSurfaceFormat();
|
QSurfaceFormat format = getDefaultOpenGLSurfaceFormat();
|
||||||
setFormat(format);
|
setFormat(format);
|
||||||
_context = new QOpenGLContext;
|
_context = new QOpenGLContext;
|
||||||
_context->setFormat(format);
|
_context->setFormat(format);
|
||||||
|
|
Loading…
Reference in a new issue