mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:03:35 +02:00
Fixes for Mac build and crash on startup
For some reason the qt code gen is getting confused by the #if 0 in 3DConnextionClient.h, so I added a stub implementation. In Application.cpp the change of moving idle into paintGL had a sideeffect of calling OffscreenGlCanvas before it was initialized. To work around this I added a guard to prevent calling idle before all the gl windows/widgets have been initialized.
This commit is contained in:
parent
8954d21ed1
commit
69f1cfbcb9
3 changed files with 23 additions and 7 deletions
|
@ -940,14 +940,12 @@ void Application::initializeGL() {
|
||||||
qCDebug(interfaceapp) << "Created Display Window.";
|
qCDebug(interfaceapp) << "Created Display Window.";
|
||||||
|
|
||||||
// initialize glut for shape drawing; Qt apparently initializes it on OS X
|
// initialize glut for shape drawing; Qt apparently initializes it on OS X
|
||||||
#ifndef __APPLE__
|
if (_isGLInitialized) {
|
||||||
static bool isInitialized = false;
|
|
||||||
if (isInitialized) {
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
isInitialized = true;
|
_isGLInitialized = true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
// Where the gpuContext is initialized and where the TRUE Backend is created and assigned
|
// Where the gpuContext is initialized and where the TRUE Backend is created and assigned
|
||||||
gpu::Context::init<gpu::GLBackend>();
|
gpu::Context::init<gpu::GLBackend>();
|
||||||
_gpuContext = std::make_shared<gpu::Context>();
|
_gpuContext = std::make_shared<gpu::Context>();
|
||||||
|
@ -1059,7 +1057,9 @@ void Application::paintGL() {
|
||||||
_lastFramesPerSecondUpdate = now;
|
_lastFramesPerSecondUpdate = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
idle(now);
|
if (_isGLInitialized) {
|
||||||
|
idle(now);
|
||||||
|
}
|
||||||
|
|
||||||
PROFILE_RANGE(__FUNCTION__);
|
PROFILE_RANGE(__FUNCTION__);
|
||||||
PerformanceTimer perfTimer("paintGL");
|
PerformanceTimer perfTimer("paintGL");
|
||||||
|
|
|
@ -414,7 +414,7 @@ private:
|
||||||
|
|
||||||
bool _dependencyManagerIsSetup;
|
bool _dependencyManagerIsSetup;
|
||||||
|
|
||||||
OffscreenGlCanvas* _offscreenContext;
|
OffscreenGlCanvas* _offscreenContext {nullptr};
|
||||||
DisplayPluginPointer _displayPlugin;
|
DisplayPluginPointer _displayPlugin;
|
||||||
InputPluginList _activeInputPlugins;
|
InputPluginList _activeInputPlugins;
|
||||||
|
|
||||||
|
@ -548,6 +548,7 @@ private:
|
||||||
quint64 _lastSimsPerSecondUpdate = 0;
|
quint64 _lastSimsPerSecondUpdate = 0;
|
||||||
bool _isForeground = true; // starts out assumed to be in foreground
|
bool _isForeground = true; // starts out assumed to be in foreground
|
||||||
bool _inPaint = false;
|
bool _inPaint = false;
|
||||||
|
bool _isGLInitialized {false};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Application_h
|
#endif // hifi_Application_h
|
||||||
|
|
|
@ -220,4 +220,19 @@ public:
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QLibrary>
|
||||||
|
|
||||||
|
// stub
|
||||||
|
class ConnexionClient : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
static ConnexionClient& getInstance();
|
||||||
|
void init() {};
|
||||||
|
void destroy() {};
|
||||||
|
bool Is3dmouseAttached() { return false; };
|
||||||
|
public slots:
|
||||||
|
void toggleConnexion(bool shouldEnable) {};
|
||||||
|
};
|
||||||
|
|
||||||
#endif // defined(hifi_3DConnexionClient_h)
|
#endif // defined(hifi_3DConnexionClient_h)
|
||||||
|
|
Loading…
Reference in a new issue