From f98305dd555f351db3deb35a9d4752a12e8616d5 Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Fri, 29 May 2015 12:45:03 -0700 Subject: [PATCH] CR comments --- libraries/octree/src/ViewFrustum.h | 4 ++-- libraries/render-utils/src/GlWindow.cpp | 18 +++--------------- libraries/render-utils/src/GlWindow.h | 11 +++++------ libraries/render-utils/src/OffscreenGlCanvas.h | 2 +- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/libraries/octree/src/ViewFrustum.h b/libraries/octree/src/ViewFrustum.h index 43bc1d992e..cd1e010818 100644 --- a/libraries/octree/src/ViewFrustum.h +++ b/libraries/octree/src/ViewFrustum.h @@ -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; } diff --git a/libraries/render-utils/src/GlWindow.cpp b/libraries/render-utils/src/GlWindow.cpp index b395140518..ec294dca5e 100644 --- a/libraries/render-utils/src/GlWindow.cpp +++ b/libraries/render-utils/src/GlWindow.cpp @@ -10,24 +10,12 @@ #include #include +#include -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; diff --git a/libraries/render-utils/src/GlWindow.h b/libraries/render-utils/src/GlWindow.h index 69fb09932e..57108c6e37 100644 --- a/libraries/render-utils/src/GlWindow.h +++ b/libraries/render-utils/src/GlWindow.h @@ -11,24 +11,23 @@ #define hifi_GlWindow_h #include -#include 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 \ No newline at end of file +#endif diff --git a/libraries/render-utils/src/OffscreenGlCanvas.h b/libraries/render-utils/src/OffscreenGlCanvas.h index c9578f5a7c..399737ddb8 100644 --- a/libraries/render-utils/src/OffscreenGlCanvas.h +++ b/libraries/render-utils/src/OffscreenGlCanvas.h @@ -31,7 +31,7 @@ protected: QOpenGLContext _context; QOffscreenSurface _offscreenSurface; #ifdef DEBUG - QOpenGLDebugLogger * _logger{ nullptr }; + QOpenGLDebugLogger* _logger{ nullptr }; #endif };