diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index 5d2e6b9293..3d6d056d79 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -2,9 +2,9 @@ Please read the [general build guide](BUILD.md) for information on building othe # Dependencies -*Currently Android building is only supported on 64 bit Linux host environments* +Building is currently supported on OSX, Windows and Linux platforms, but developers intending to do work on the library dependencies are strongly urged to use 64 bit Linux as a build platform -You will need the following tools to build our Android targets. +You will need the following tools to build Android targets. * [Gradle](https://gradle.org/install/) * [Android Studio](https://developer.android.com/studio/index.html) diff --git a/CMakeLists.txt b/CMakeLists.txt index e033efa982..34ff672067 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,8 +41,10 @@ endif() if (ANDROID) set(PLATFORM_QT_COMPONENTS AndroidExtras WebView) + set(PLATFORM_GL_BACKEND gpu-gles) else () set(PLATFORM_QT_COMPONENTS WebEngine WebEngineWidgets) + set(PLATFORM_GL_BACKEND gpu-gl) endif () foreach(PLATFORM_QT_COMPONENT ${PLATFORM_QT_COMPONENTS}) diff --git a/android/app/CMakeLists.txt b/android/app/CMakeLists.txt index 450aa7bc5e..4411b7b1bb 100644 --- a/android/app/CMakeLists.txt +++ b/android/app/CMakeLists.txt @@ -1,8 +1,26 @@ set(TARGET_NAME native-lib) setup_hifi_library(Gui Qml Quick) -link_hifi_libraries(shared networking gl gpu gpu-gles image fbx render-utils physics entities octree audio midi recording controllers script-engine ui) + +# Minimal dependencies for testing UI compositing #link_hifi_libraries(shared networking gl ui) +link_hifi_libraries( + shared networking octree + script-engine recording trackers + gl ktx image gpu gpu-gles render render-utils + physics + audio audio-client + ui midi controllers pointers + model model-networking fbx animation + entities entities-renderer + avatars avatars-renderer + ui-plugins input-plugins + # display-plugins + # auto-updater +) + + target_link_libraries(native-lib android log m) target_opengl() -target_bullet() \ No newline at end of file +target_bullet() + diff --git a/android/app/src/main/cpp/main.cpp b/android/app/src/main/cpp/main.cpp index 24f264d327..b947323720 100644 --- a/android/app/src/main/cpp/main.cpp +++ b/android/app/src/main/cpp/main.cpp @@ -89,9 +89,7 @@ int main(int argc, char* argv[]) qFatal("Unable to create primary offscreen context"); } qt_gl_set_global_share_context(sharedCanvas.getContext()); - auto globalContext = QOpenGLContext::globalShareContext(); - bool threadedGlRendering = QOpenGLContext::supportsThreadedOpenGL(); GLWindow window; window.create(); @@ -104,9 +102,7 @@ int main(int argc, char* argv[]) GLuint fbo = 0; glGenFramebuffers(1, &fbo); - - - ivec2 offscreenSize { 640, 480 }; + static const ivec2 offscreenSize { 640, 480 }; OffscreenQmlSurface::setSharedContext(sharedCanvas.getContext()); OffscreenQmlSurface* qmlSurface = new OffscreenQmlSurface(); diff --git a/android/build.gradle b/android/build.gradle index 015f80967b..653c3f84b5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -101,7 +101,7 @@ def packages = [ ], polyvox: [ file: 'polyvox_armv8-libcpp.tgz', - checksum: '5c918288741ee754c16aeb12bb46b9e1', + checksum: '349ad5b72aaf2749ca95d847e60c5314', sharedLibFolder: 'lib', includeLibs: ['Release/libPolyVoxCore.so', 'libPolyVoxUtil.so'], ], diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index a38d428eba..7625d69211 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -201,14 +201,14 @@ endif() # link required hifi libraries link_hifi_libraries( - shared octree ktx gpu gl gpu-gl procedural model render + shared octree ktx gpu gl procedural model render pointers recording fbx networking model-networking entities avatars trackers audio audio-client animation script-engine physics render-utils entities-renderer avatars-renderer ui auto-updater midi controllers plugins image trackers ui-plugins display-plugins input-plugins - ${NON_ANDROID_LIBRARIES} + ${PLATFORM_GL_BACKEND} ) # include the binary directory of render-utils for shader includes diff --git a/libraries/avatars-renderer/CMakeLists.txt b/libraries/avatars-renderer/CMakeLists.txt index bfbeab086d..148835965e 100644 --- a/libraries/avatars-renderer/CMakeLists.txt +++ b/libraries/avatars-renderer/CMakeLists.txt @@ -1,12 +1,11 @@ set(TARGET_NAME avatars-renderer) AUTOSCRIBE_SHADER_LIB(gpu model render render-utils) setup_hifi_library(Widgets Network Script) -link_hifi_libraries(shared gpu model animation model-networking script-engine render image render-utils) +link_hifi_libraries(shared gpu model animation model-networking script-engine render render-utils image trackers entities-renderer) include_hifi_library_headers(avatars) include_hifi_library_headers(networking) include_hifi_library_headers(fbx) include_hifi_library_headers(recording) -include_hifi_library_headers(trackers) include_hifi_library_headers(ktx) include_hifi_library_headers(procedural) include_hifi_library_headers(physics) diff --git a/libraries/display-plugins/CMakeLists.txt b/libraries/display-plugins/CMakeLists.txt index 83a1c635ca..1fd855e6aa 100644 --- a/libraries/display-plugins/CMakeLists.txt +++ b/libraries/display-plugins/CMakeLists.txt @@ -1,7 +1,7 @@ set(TARGET_NAME display-plugins) AUTOSCRIBE_SHADER_LIB(gpu display-plugins) setup_hifi_library(OpenGL) -link_hifi_libraries(shared plugins ui-plugins gl gpu-gl ui render-utils) +link_hifi_libraries(shared plugins ui-plugins gl ui render-utils ${PLATFORM_GL_BACKEND}) include_hifi_library_headers(gpu) include_hifi_library_headers(model-networking) include_hifi_library_headers(networking) diff --git a/libraries/entities-renderer/CMakeLists.txt b/libraries/entities-renderer/CMakeLists.txt index 7ac6456081..cf94ecc37c 100644 --- a/libraries/entities-renderer/CMakeLists.txt +++ b/libraries/entities-renderer/CMakeLists.txt @@ -15,9 +15,4 @@ include_hifi_library_headers(avatars) include_hifi_library_headers(controllers) target_bullet() - -add_dependency_external_projects(polyvox) -find_package(PolyVox REQUIRED) -target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${POLYVOX_INCLUDE_DIRS}) -target_link_libraries(${TARGET_NAME} ${POLYVOX_LIBRARIES}) - +target_polyvox() \ No newline at end of file diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.h b/libraries/entities-renderer/src/EntityTreeRenderer.h index 04048e5f92..dccd14aac6 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.h +++ b/libraries/entities-renderer/src/EntityTreeRenderer.h @@ -12,13 +12,13 @@ #ifndef hifi_EntityTreeRenderer_h #define hifi_EntityTreeRenderer_h -#include -#include +#include +#include +#include #include #include // for RayToEntityIntersectionResult #include -#include #include #include #include diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index 24de651247..9e32977de1 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -373,7 +373,7 @@ void EntityRenderer::onAddToScene(const EntityItemPointer& entity) { renderer->onEntityChanged(_entity->getID()); } }, Qt::QueuedConnection); - _changeHandlerId = entity->registerChangeHandler([this](const EntityItemID& changedEntity) { + _changeHandlerId = entity->registerChangeHandler([](const EntityItemID& changedEntity) { auto renderer = DependencyManager::get(); if (renderer) { renderer->onEntityChanged(changedEntity); diff --git a/libraries/script-engine/src/ConsoleScriptingInterface.h b/libraries/script-engine/src/ConsoleScriptingInterface.h index 444ea93504..deb0d126f9 100644 --- a/libraries/script-engine/src/ConsoleScriptingInterface.h +++ b/libraries/script-engine/src/ConsoleScriptingInterface.h @@ -21,9 +21,10 @@ #include #include +#include +#include +#include #include -#include -#include // Scriptable interface of "console" object. Used exclusively in the JavaScript API class ConsoleScriptingInterface : public QObject, protected QScriptable {