mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
fix merge from upstream
This commit is contained in:
parent
e9422cbf1e
commit
cc4f4ac506
2 changed files with 15 additions and 1 deletions
|
@ -118,6 +118,19 @@ void Web3DOverlay::update(float deltatime) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Web3DOverlay::pickURL() {
|
||||||
|
QUrl sourceUrl(_url);
|
||||||
|
if (sourceUrl.scheme() == "http" || sourceUrl.scheme() == "https" ||
|
||||||
|
_url.toLower().endsWith(".htm") || _url.toLower().endsWith(".html")) {
|
||||||
|
|
||||||
|
_webSurface->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
||||||
|
return "Web3DOverlay.qml";
|
||||||
|
} else {
|
||||||
|
return QUrl::fromLocalFile(PathUtils::resourcesPath()).toString() + "/" + _url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Web3DOverlay::loadSourceURL() {
|
void Web3DOverlay::loadSourceURL() {
|
||||||
|
|
||||||
QUrl sourceUrl(_url);
|
QUrl sourceUrl(_url);
|
||||||
|
@ -152,7 +165,7 @@ void Web3DOverlay::render(RenderArgs* args) {
|
||||||
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
|
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
|
||||||
QSurface * currentSurface = currentContext->surface();
|
QSurface * currentSurface = currentContext->surface();
|
||||||
if (!_webSurface) {
|
if (!_webSurface) {
|
||||||
_webSurface = DependencyManager::get<OffscreenQmlSurfaceCache>()->acquire(QML);
|
_webSurface = DependencyManager::get<OffscreenQmlSurfaceCache>()->acquire(pickURL());
|
||||||
_webSurface->setMaxFps(10);
|
_webSurface->setMaxFps(10);
|
||||||
// FIXME, the max FPS could be better managed by being dynamic (based on the number of current surfaces
|
// FIXME, the max FPS could be better managed by being dynamic (based on the number of current surfaces
|
||||||
// and the current rendering load)
|
// and the current rendering load)
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
Web3DOverlay(const Web3DOverlay* Web3DOverlay);
|
Web3DOverlay(const Web3DOverlay* Web3DOverlay);
|
||||||
virtual ~Web3DOverlay();
|
virtual ~Web3DOverlay();
|
||||||
|
|
||||||
|
QString pickURL();
|
||||||
void loadSourceURL();
|
void loadSourceURL();
|
||||||
virtual void render(RenderArgs* args) override;
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
Loading…
Reference in a new issue