Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -22,6 +22,9 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <glm/gtx/quaternion.hpp> |
| 23 | 23 | #include <glm/gtx/vector_angle.hpp> |
| 24 | 24 | |
| 25 | +// include this before QGLWidget, which includes an earlier version of OpenGL | |
| 26 | +#include "InterfaceConfig.h" | |
| 27 | + | |
| 25 | 28 | #include <QActionGroup> |
| 26 | 29 | #include <QBoxLayout> |
| 27 | 30 | #include <QColorDialog> |
| @@ -59,7 +62,6 @@ · 31 unmodified lines | ||
| 59 | 62 | #include <VoxelSceneStats.h> |
| 60 | 63 | |
| 61 | 64 | #include "Application.h" |
| 62 | −#include "InterfaceConfig.h" | |
| 63 | 65 | #include "LogDisplay.h" |
| 64 | 66 | #include "LeapManager.h" |
| 65 | 67 | #include "OculusManager.h" |
| @@ -92,6 +94,10 @@ const int STARTUP_JITTER_SAMPLES = PACKET_LENGTH_SAMPLES_PER_CHANNEL / 2; · 26 unmodified lines | ||
| 92 | 94 | |
| 93 | 95 | // customized canvas that simply forwards requests/events to the singleton application |
| 94 | 96 | class GLCanvas : public QGLWidget { |
| 97 | +public: | |
| 98 | + | |
| 99 | + GLCanvas(); | |
| 100 | + | |
| 95 | 101 | protected: |
| 96 | 102 | |
| 97 | 103 | virtual void initializeGL(); |
| @@ -110,6 +116,9 @@ protected: · 12 unmodified lines | ||
| 110 | 116 | virtual void wheelEvent(QWheelEvent* event); |
| 111 | 117 | }; |
| 112 | 118 | |
| 119 | +GLCanvas::GLCanvas() : QGLWidget(QGLFormat(QGL::AlphaChannel)) { | |
| 120 | +} | |
| 121 | + | |
| 113 | 122 | void GLCanvas::initializeGL() { |
| 114 | 123 | Application::getInstance()->initializeGL(); |
| 115 | 124 | setAttribute(Qt::WA_AcceptTouchEvents); |
| @@ -2199,8 +2208,8 @@ void Application::runTests() { · 2083 unmodified lines | ||
| 2199 | 2208 | |
| 2200 | 2209 | void Application::initDisplay() { |
| 2201 | 2210 | glEnable(GL_BLEND); |
| 2202 | − glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |
| 2203 | − glShadeModel (GL_SMOOTH); | |
| 2211 | + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_CONSTANT_ALPHA, GL_ONE); | |
| 2212 | + glShadeModel(GL_SMOOTH); | |
| 2204 | 2213 | glEnable(GL_LIGHTING); |
| 2205 | 2214 | glEnable(GL_LIGHT0); |
| 2206 | 2215 | glEnable(GL_DEPTH_TEST); |
| @@ -3001,6 +3010,9 @@ void Application::displaySide(Camera& whichCamera) { · 794 unmodified lines | ||
| 3001 | 3010 | // Setup 3D lights (after the camera transform, so that they are positioned in world space) |
| 3002 | 3011 | setupWorldLight(whichCamera); |
| 3003 | 3012 | |
| 3013 | + // prepare the glow effect | |
| 3014 | + _glowEffect.prepare(); | |
| 3015 | + | |
| 3004 | 3016 | if (_renderStarsOn->isChecked()) { |
| 3005 | 3017 | if (!_stars.getFileLoaded()) { |
| 3006 | 3018 | _stars.readInput(STAR_FILE, STAR_CACHE_FILE, 0); |
| @@ -3033,9 +3045,6 @@ void Application::displaySide(Camera& whichCamera) { · 26 unmodified lines | ||
| 3033 | 3045 | glEnable(GL_LIGHTING); |
| 3034 | 3046 | glEnable(GL_DEPTH_TEST); |
| 3035 | 3047 | |
| 3036 | − // prepare the glow effect | |
| 3037 | − _glowEffect.prepare(); | |
| 3038 | − | |
| 3039 | 3048 | // Enable to show line from me to the voxel I am touching |
| 3040 | 3049 | //renderLineToTouchedVoxel(); |
| 3041 | 3050 | //renderThrustAtVoxel(_voxelThrust); |
| @@ -3131,13 +3140,9 @@ void Application::displaySide(Camera& whichCamera) { · 89 unmodified lines | ||
| 3131 | 3140 | if (_myCamera.getMode() == CAMERA_MODE_MIRROR) { |
| 3132 | 3141 | _myAvatar.getHead().setLookAtPosition(_myCamera.getPosition()); |
| 3133 | 3142 | } |
| 3143 | + _glowEffect.begin(); | |
| 3134 | 3144 | _myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked()); |
| 3135 | − | |
| 3136 | − _glowEffect.bind(); | |
| 3137 | − _myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked()); | |
| 3138 | − _glowEffect.release(); | |
| 3139 | − | |
| 3140 | − _myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked()); | |
| 3145 | + _glowEffect.end(); | |
| 3141 | 3146 | |
| 3142 | 3147 | _myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked()); |
| 3143 | 3148 | |