mirror of
https://github.com/overte-org/overte.git
synced 2025-04-18 23:17:10 +02:00
CR comments
This commit is contained in:
parent
8bad80324f
commit
f98305dd55
4 changed files with 11 additions and 24 deletions
|
@ -52,8 +52,8 @@ public:
|
|||
void getFocalLength(float focalLength) { _focalLength = focalLength; }
|
||||
|
||||
// getters for lens attributes
|
||||
const glm::mat4& getProjection() const { return _projection; };
|
||||
const glm::mat4& getView() const { return _view; };
|
||||
const glm::mat4& getProjection() const { return _projection; }
|
||||
const glm::mat4& getView() const { return _view; }
|
||||
float getWidth() const { return _width; }
|
||||
float getHeight() const { return _height; }
|
||||
float getFieldOfView() const { return _fieldOfView; }
|
||||
|
|
|
@ -10,24 +10,12 @@
|
|||
|
||||
#include <QOpenGLContext>
|
||||
#include <QOpenGLDebugLogger>
|
||||
#include <GLHelpers.h>
|
||||
|
||||
static QSurfaceFormat getDefaultFormat() {
|
||||
QSurfaceFormat format;
|
||||
// Qt Quick may need a depth and stencil buffer. Always make sure these are available.
|
||||
format.setDepthBufferSize(16);
|
||||
format.setStencilBufferSize(8);
|
||||
format.setVersion(4, 1);
|
||||
#ifdef DEBUG
|
||||
format.setOption(QSurfaceFormat::DebugContext);
|
||||
#endif
|
||||
format.setProfile(QSurfaceFormat::OpenGLContextProfile::CompatibilityProfile);
|
||||
return format;
|
||||
GlWindow::GlWindow(QOpenGLContext* shareContext) : GlWindow(getDefaultOpenGlSurfaceFormat(), shareContext) {
|
||||
}
|
||||
|
||||
GlWindow::GlWindow(QOpenGLContext * shareContext) : GlWindow(getDefaultFormat(), shareContext) {
|
||||
}
|
||||
|
||||
GlWindow::GlWindow(const QSurfaceFormat& format, QOpenGLContext * shareContext) {
|
||||
GlWindow::GlWindow(const QSurfaceFormat& format, QOpenGLContext* shareContext) {
|
||||
setSurfaceType(QSurface::OpenGLSurface);
|
||||
setFormat(format);
|
||||
_context = new QOpenGLContext;
|
||||
|
|
|
@ -11,24 +11,23 @@
|
|||
#define hifi_GlWindow_h
|
||||
|
||||
#include <QWindow>
|
||||
#include <QSurfaceFormat>
|
||||
|
||||
class QOpenGLContext;
|
||||
class QOpenGLDebugLogger;
|
||||
|
||||
class GlWindow : public QWindow {
|
||||
public:
|
||||
GlWindow(QOpenGLContext * shareContext = nullptr);
|
||||
GlWindow(const QSurfaceFormat& format, QOpenGLContext * shareContext = nullptr);
|
||||
GlWindow(QOpenGLContext* shareContext = nullptr);
|
||||
GlWindow(const QSurfaceFormat& format, QOpenGLContext* shareContext = nullptr);
|
||||
virtual ~GlWindow();
|
||||
void makeCurrent();
|
||||
void doneCurrent();
|
||||
void swapBuffers();
|
||||
private:
|
||||
QOpenGLContext * _context{ nullptr };
|
||||
QOpenGLContext* _context{ nullptr };
|
||||
#ifdef DEBUG
|
||||
QOpenGLDebugLogger * _logger{ nullptr };
|
||||
QOpenGLDebugLogger* _logger{ nullptr };
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ protected:
|
|||
QOpenGLContext _context;
|
||||
QOffscreenSurface _offscreenSurface;
|
||||
#ifdef DEBUG
|
||||
QOpenGLDebugLogger * _logger{ nullptr };
|
||||
QOpenGLDebugLogger* _logger{ nullptr };
|
||||
#endif
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue