mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
use a QOpenGLWidget subclass for InterfaceView
This commit is contained in:
parent
6e7dc0a44c
commit
3dd0b85ca4
6 changed files with 51 additions and 15 deletions
|
@ -6,6 +6,8 @@ You will need the following tools to build our Android targets.
|
||||||
|
|
||||||
* [cmake](http://www.cmake.org/download/) ~> 3.1.0
|
* [cmake](http://www.cmake.org/download/) ~> 3.1.0
|
||||||
* Note that this is a newer version required than the minimum for hifi desktop targets.
|
* Note that this is a newer version required than the minimum for hifi desktop targets.
|
||||||
|
* [Qt](http://www.qt.io/download-open-source/#) ~> 5.4.0
|
||||||
|
* Note that this is a newer version required than the minimum for hifi desktop targets.
|
||||||
* [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
|
* [ant](http://ant.apache.org/bindownload.cgi) ~> 1.9.4
|
||||||
* [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
|
* [Android NDK](https://developer.android.com/tools/sdk/ndk/index.html) = r10c
|
||||||
* [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2
|
* [Android SDK](http://developer.android.com/sdk/installing/index.html) ~> 24.0.2
|
||||||
|
@ -29,7 +31,7 @@ This is most easily accomplished by installing all Android dependencies in the s
|
||||||
|
|
||||||
####Qt
|
####Qt
|
||||||
|
|
||||||
Install Qt 5.3 for Android for your host environment from the [Qt downloads page](http://www.qt.io/download/). Install Qt to ``$ANDROID_LIB_DIR/Qt``. This is required so that our root CMakeLists file can help CMake find your Android Qt installation.
|
Install Qt 5.4 for Android for your host environment from the [Qt downloads page](http://www.qt.io/download/). Install Qt to ``$ANDROID_LIB_DIR/Qt``. This is required so that our root CMakeLists file can help CMake find your Android Qt installation.
|
||||||
|
|
||||||
The component required for the Android build is the `Android armv7` component.
|
The component required for the Android build is the `Android armv7` component.
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ endif ()
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
if (NOT ANDROID_QT_CMAKE_PREFIX_PATH)
|
if (NOT ANDROID_QT_CMAKE_PREFIX_PATH)
|
||||||
set(QT_CMAKE_PREFIX_PATH ${ANDROID_LIB_DIR}/Qt/5.3/android_armv7/lib/cmake)
|
set(QT_CMAKE_PREFIX_PATH ${ANDROID_LIB_DIR}/Qt/5.4/android_armv7/lib/cmake)
|
||||||
else ()
|
else ()
|
||||||
set(QT_CMAKE_PREFIX_PATH ${ANDROID_QT_CMAKE_PREFIX_PATH})
|
set(QT_CMAKE_PREFIX_PATH ${ANDROID_QT_CMAKE_PREFIX_PATH})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -51,19 +51,6 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||||
QTimer* idleTimer = new QTimer(this);
|
QTimer* idleTimer = new QTimer(this);
|
||||||
connect(idleTimer, &QTimer::timeout, this, &GVRInterface::idle);
|
connect(idleTimer, &QTimer::timeout, this, &GVRInterface::idle);
|
||||||
idleTimer->start(0);
|
idleTimer->start(0);
|
||||||
|
|
||||||
// // setup our EGL context
|
|
||||||
// const int windowDepth = 0;
|
|
||||||
// const int windowSamples = 0;
|
|
||||||
// const GLuint contextPriority = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
|
|
||||||
// OVR::eglSetup_t egl = OVR::EglSetup(EGL_NO_CONTEXT, GL_ES_VERSION,
|
|
||||||
// 8, 8, 8, windowDepth, windowSamples, contextPriority);
|
|
||||||
//
|
|
||||||
// if (egl.context == EGL_NO_CONTEXT) {
|
|
||||||
// qDebug() << "WE HAD SOME DIFFICULTIES SETTING UP EGL!";
|
|
||||||
// } else {
|
|
||||||
// qDebug() << "EGL is good to go.";
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVRInterface::idle() {
|
void GVRInterface::idle() {
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include <AddressManager.h>
|
#include <AddressManager.h>
|
||||||
|
|
||||||
|
#include "InterfaceView.h"
|
||||||
#include "RenderingClient.h"
|
#include "RenderingClient.h"
|
||||||
|
|
||||||
#include "GVRMainWindow.h"
|
#include "GVRMainWindow.h"
|
||||||
|
@ -48,6 +49,9 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||||
baseWidget->setLayout(_mainLayout);
|
baseWidget->setLayout(_mainLayout);
|
||||||
|
|
||||||
setCentralWidget(baseWidget);
|
setCentralWidget(baseWidget);
|
||||||
|
|
||||||
|
// add the interface view
|
||||||
|
InterfaceView* interfaceView = new InterfaceView(baseWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVRMainWindow::showAddressBar() {
|
void GVRMainWindow::showAddressBar() {
|
||||||
|
|
20
gvr-interface/src/InterfaceView.cpp
Normal file
20
gvr-interface/src/InterfaceView.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// InterfaceView.cpp
|
||||||
|
// gvr-interface/src
|
||||||
|
//
|
||||||
|
// Created by Stephen Birarda on 1/28/14.
|
||||||
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
#include "InterfaceView.h"
|
||||||
|
|
||||||
|
InterfaceView::InterfaceView(QWidget* parent, Qt::WindowFlags flags) :
|
||||||
|
QOpenGLWidget(parent, flags)
|
||||||
|
{
|
||||||
|
qDebug() << "The interface view is alive!";
|
||||||
|
}
|
23
gvr-interface/src/InterfaceView.h
Normal file
23
gvr-interface/src/InterfaceView.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
//
|
||||||
|
// InterfaceView.h
|
||||||
|
// gvr-interface/src
|
||||||
|
//
|
||||||
|
// Created by Stephen Birarda on 1/28/14.
|
||||||
|
// Copyright 2013 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_InterfaceView_h
|
||||||
|
#define hifi_InterfaceView_h
|
||||||
|
|
||||||
|
#include <QtWidgets/QOpenGLWidget>
|
||||||
|
|
||||||
|
class InterfaceView : public QOpenGLWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
InterfaceView(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_InterfaceView_h
|
Loading…
Reference in a new issue