mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 22:09:02 +02:00
Merge remote-tracking branch 'upstream/master' into vive-ui
This commit is contained in:
commit
5bc8b53d1b
22 changed files with 216 additions and 51 deletions
62
cmake/externals/steamworks/CMakeLists.txt
vendored
Normal file
62
cmake/externals/steamworks/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
include(ExternalProject)
|
||||||
|
|
||||||
|
set(EXTERNAL_NAME steamworks)
|
||||||
|
|
||||||
|
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||||
|
|
||||||
|
set(STEAMWORKS_URL "https://s3.amazonaws.com/hifi-public/dependencies/steamworks_sdk_137.zip")
|
||||||
|
set(STEAMWORKS_URL_MD5 "95ba9d0e3ddc04f8a8be17d2da806cbb")
|
||||||
|
|
||||||
|
ExternalProject_Add(
|
||||||
|
${EXTERNAL_NAME}
|
||||||
|
URL ${STEAMWORKS_URL}
|
||||||
|
URL_MD5 ${STEAMWORKS_URL_MD5}
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
LOG_DOWNLOAD 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||||
|
|
||||||
|
ExternalProject_Get_Property(${EXTERNAL_NAME} SOURCE_DIR)
|
||||||
|
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${SOURCE_DIR}/public CACHE TYPE INTERNAL)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
|
||||||
|
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
||||||
|
set(ARCH_DIR ${SOURCE_DIR}/redistributable_bin/win64)
|
||||||
|
set(ARCH_SUFFIX "64")
|
||||||
|
else()
|
||||||
|
set(ARCH_DIR ${SOURCE_DIR}/redistributable_bin)
|
||||||
|
set(ARCH_SUFFIX "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${ARCH_DIR})
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_LIB_PATH ${ARCH_DIR})
|
||||||
|
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE "${${EXTERNAL_NAME_UPPER}_LIB_PATH}/steam_api${ARCH_SUFFIX}.lib" CACHE TYPE INTERNAL)
|
||||||
|
add_paths_to_fixup_libs("${${EXTERNAL_NAME_UPPER}_DLL_PATH}")
|
||||||
|
|
||||||
|
elseif(APPLE)
|
||||||
|
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/osx32/libsteam_api.dylib CACHE TYPE INTERNAL)
|
||||||
|
|
||||||
|
set(_STEAMWORKS_LIB_DIR "${SOURCE_DIR}/redistributable_bin/osx32")
|
||||||
|
ExternalProject_Add_Step(
|
||||||
|
${EXTERNAL_NAME}
|
||||||
|
change-install-name
|
||||||
|
COMMENT "Calling install_name_tool on libraries to fix install name for dylib linking"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -DINSTALL_NAME_LIBRARY_DIR=${_STEAMWORKS_LIB_DIR} -P ${EXTERNAL_PROJECT_DIR}/OSXInstallNameChange.cmake
|
||||||
|
DEPENDEES install
|
||||||
|
WORKING_DIRECTORY <SOURCE_DIR>
|
||||||
|
LOG 1
|
||||||
|
)
|
||||||
|
|
||||||
|
elseif(NOT ANDROID)
|
||||||
|
|
||||||
|
# FIXME need to account for different architectures
|
||||||
|
set(${EXTERNAL_NAME_UPPER}_LIBRARY_RELEASE ${SOURCE_DIR}/redistributable_bin/linux64/libsteam_api.so CACHE TYPE INTERNAL)
|
||||||
|
|
||||||
|
endif()
|
13
cmake/macros/TargetSteamworks.cmake
Normal file
13
cmake/macros/TargetSteamworks.cmake
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#
|
||||||
|
# Copyright 2015 High Fidelity, Inc.
|
||||||
|
# Created by Clement Brisset on 6/8/2016
|
||||||
|
#
|
||||||
|
# Distributed under the Apache License, Version 2.0.
|
||||||
|
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
#
|
||||||
|
macro(TARGET_STEAMWORKS)
|
||||||
|
add_dependency_external_projects(steamworks)
|
||||||
|
find_package(Steamworks REQUIRED)
|
||||||
|
target_include_directories(${TARGET_NAME} PRIVATE ${STEAMWORKS_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(${TARGET_NAME} ${STEAMWORKS_LIBRARIES})
|
||||||
|
endmacro()
|
29
cmake/modules/FindSteamworks.cmake
Normal file
29
cmake/modules/FindSteamworks.cmake
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#
|
||||||
|
# FindSteamworks.cmake
|
||||||
|
#
|
||||||
|
# Try to find the Steamworks controller library
|
||||||
|
#
|
||||||
|
# This module defines the following variables
|
||||||
|
#
|
||||||
|
# STEAMWORKS_FOUND - Was Steamworks found
|
||||||
|
# STEAMWORKS_INCLUDE_DIRS - the Steamworks include directory
|
||||||
|
# STEAMWORKS_LIBRARIES - Link this to use Steamworks
|
||||||
|
#
|
||||||
|
# This module accepts the following variables
|
||||||
|
#
|
||||||
|
# STEAMWORKS_ROOT - Can be set to steamworks install path or Windows build path
|
||||||
|
#
|
||||||
|
# Created on 6/8/2016 by Clement Brisset
|
||||||
|
# Copyright 2016 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(SelectLibraryConfigurations)
|
||||||
|
select_library_configurations(STEAMWORKS)
|
||||||
|
|
||||||
|
set(STEAMWORKS_REQUIREMENTS STEAMWORKS_INCLUDE_DIRS STEAMWORKS_LIBRARIES)
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Steamworks DEFAULT_MSG STEAMWORKS_INCLUDE_DIRS STEAMWORKS_LIBRARIES)
|
||||||
|
mark_as_advanced(STEAMWORKS_LIBRARIES STEAMWORKS_INCLUDE_DIRS STEAMWORKS_SEARCH_DIRS)
|
|
@ -139,7 +139,7 @@ link_hifi_libraries(shared octree gpu gl gpu-gl procedural model render
|
||||||
recording fbx networking model-networking entities avatars
|
recording fbx networking model-networking entities avatars
|
||||||
audio audio-client animation script-engine physics
|
audio audio-client animation script-engine physics
|
||||||
render-utils entities-renderer ui auto-updater
|
render-utils entities-renderer ui auto-updater
|
||||||
controllers plugins display-plugins input-plugins)
|
controllers plugins display-plugins input-plugins steamworks-wrapper)
|
||||||
|
|
||||||
# include the binary directory of render-utils for shader includes
|
# include the binary directory of render-utils for shader includes
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/libraries/render-utils")
|
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/libraries/render-utils")
|
||||||
|
|
|
@ -389,7 +389,10 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
|
|
||||||
Setting::preInit();
|
Setting::preInit();
|
||||||
|
|
||||||
bool previousSessionCrashed = CrashHandler::checkForResetSettings();
|
|
||||||
|
static const auto SUPPRESS_SETTINGS_RESET = "--suppress-settings-reset";
|
||||||
|
bool suppressPrompt = cmdOptionExists(argc, const_cast<const char**>(argv), SUPPRESS_SETTINGS_RESET);
|
||||||
|
bool previousSessionCrashed = CrashHandler::checkForResetSettings(suppressPrompt);
|
||||||
CrashHandler::writeRunningMarkerFiler();
|
CrashHandler::writeRunningMarkerFiler();
|
||||||
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
qAddPostRoutine(CrashHandler::deleteRunningMarkerFile);
|
||||||
|
|
||||||
|
@ -2916,7 +2919,7 @@ bool Application::exportEntities(const QString& filename, const QVector<EntityIt
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (success) {
|
if (success) {
|
||||||
exportTree->writeToJSONFile(filename.toLocal8Bit().constData());
|
success = exportTree->writeToJSONFile(filename.toLocal8Bit().constData());
|
||||||
|
|
||||||
// restore the main window's active state
|
// restore the main window's active state
|
||||||
_window->activateWindow();
|
_window->activateWindow();
|
||||||
|
@ -5145,13 +5148,6 @@ void Application::updateDisplayMode() {
|
||||||
QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) {
|
QObject::connect(displayPlugin.get(), &DisplayPlugin::recommendedFramebufferSizeChanged, [this](const QSize & size) {
|
||||||
resizeGL();
|
resizeGL();
|
||||||
});
|
});
|
||||||
QObject::connect(displayPlugin.get(), &DisplayPlugin::outputDeviceLost, [this, displayPluginName] {
|
|
||||||
PluginManager::getInstance()->disableDisplayPlugin(displayPluginName);
|
|
||||||
auto menu = Menu::getInstance();
|
|
||||||
if (menu->menuItemExists(MenuOption::OutputMenu, displayPluginName)) {
|
|
||||||
menu->removeMenuItem(MenuOption::OutputMenu, displayPluginName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
static const QString RUNNING_MARKER_FILENAME = "Interface.running";
|
||||||
|
|
||||||
bool CrashHandler::checkForResetSettings() {
|
bool CrashHandler::checkForResetSettings(bool suppressPrompt) {
|
||||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("Developer");
|
settings.beginGroup("Developer");
|
||||||
|
@ -42,6 +42,10 @@ bool CrashHandler::checkForResetSettings() {
|
||||||
QFile runningMarkerFile(runningMarkerFilePath());
|
QFile runningMarkerFile(runningMarkerFilePath());
|
||||||
bool wasLikelyCrash = runningMarkerFile.exists();
|
bool wasLikelyCrash = runningMarkerFile.exists();
|
||||||
|
|
||||||
|
if (suppressPrompt) {
|
||||||
|
return wasLikelyCrash;
|
||||||
|
}
|
||||||
|
|
||||||
if (wasLikelyCrash || askToResetSettings) {
|
if (wasLikelyCrash || askToResetSettings) {
|
||||||
if (displaySettingsResetOnCrash || askToResetSettings) {
|
if (displaySettingsResetOnCrash || askToResetSettings) {
|
||||||
Action action = promptUserForAction(wasLikelyCrash);
|
Action action = promptUserForAction(wasLikelyCrash);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
class CrashHandler {
|
class CrashHandler {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool checkForResetSettings();
|
static bool checkForResetSettings(bool suppressPrompt = false);
|
||||||
|
|
||||||
static void writeRunningMarkerFiler();
|
static void writeRunningMarkerFiler();
|
||||||
static void deleteRunningMarkerFile();
|
static void deleteRunningMarkerFile();
|
||||||
|
|
|
@ -189,7 +189,7 @@ void EntityTreeElement::elementEncodeComplete(EncodeBitstreamParams& params) con
|
||||||
// encoud our parent... this might happen.
|
// encoud our parent... this might happen.
|
||||||
if (extraEncodeData->contains(childElement.get())) {
|
if (extraEncodeData->contains(childElement.get())) {
|
||||||
EntityTreeElementExtraEncodeData* childExtraEncodeData
|
EntityTreeElementExtraEncodeData* childExtraEncodeData
|
||||||
= static_cast<EntityTreeElementExtraEncodeData*>(extraEncodeData->value(childElement.get()));
|
= static_cast<EntityTreeElementExtraEncodeData*>((*extraEncodeData)[childElement.get()]);
|
||||||
|
|
||||||
if (wantDebug) {
|
if (wantDebug) {
|
||||||
qCDebug(entities) << "checking child: " << childElement->_cube;
|
qCDebug(entities) << "checking child: " << childElement->_cube;
|
||||||
|
|
|
@ -1868,24 +1868,26 @@ bool Octree::readJSONFromStream(unsigned long streamLength, QDataStream& inputSt
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToFile(const char* fileName, OctreeElementPointer element, QString persistAsFileType) {
|
bool Octree::writeToFile(const char* fileName, OctreeElementPointer element, QString persistAsFileType) {
|
||||||
// make the sure file extension makes sense
|
// make the sure file extension makes sense
|
||||||
QString qFileName = fileNameWithoutExtension(QString(fileName), PERSIST_EXTENSIONS) + "." + persistAsFileType;
|
QString qFileName = fileNameWithoutExtension(QString(fileName), PERSIST_EXTENSIONS) + "." + persistAsFileType;
|
||||||
QByteArray byteArray = qFileName.toUtf8();
|
QByteArray byteArray = qFileName.toUtf8();
|
||||||
const char* cFileName = byteArray.constData();
|
const char* cFileName = byteArray.constData();
|
||||||
|
|
||||||
|
bool success = false;
|
||||||
if (persistAsFileType == "svo") {
|
if (persistAsFileType == "svo") {
|
||||||
writeToSVOFile(fileName, element);
|
success = writeToSVOFile(fileName, element);
|
||||||
} else if (persistAsFileType == "json") {
|
} else if (persistAsFileType == "json") {
|
||||||
writeToJSONFile(cFileName, element);
|
success = writeToJSONFile(cFileName, element);
|
||||||
} else if (persistAsFileType == "json.gz") {
|
} else if (persistAsFileType == "json.gz") {
|
||||||
writeToJSONFile(cFileName, element, true);
|
success = writeToJSONFile(cFileName, element, true);
|
||||||
} else {
|
} else {
|
||||||
qCDebug(octree) << "unable to write octree to file of type" << persistAsFileType;
|
qCDebug(octree) << "unable to write octree to file of type" << persistAsFileType;
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element, bool doGzip) {
|
bool Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element, bool doGzip) {
|
||||||
QVariantMap entityDescription;
|
QVariantMap entityDescription;
|
||||||
|
|
||||||
qCDebug(octree, "Saving JSON SVO to file %s...", fileName);
|
qCDebug(octree, "Saving JSON SVO to file %s...", fileName);
|
||||||
|
@ -1906,7 +1908,7 @@ void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element,
|
||||||
bool entityDescriptionSuccess = writeToMap(entityDescription, top, true, true);
|
bool entityDescriptionSuccess = writeToMap(entityDescription, top, true, true);
|
||||||
if (!entityDescriptionSuccess) {
|
if (!entityDescriptionSuccess) {
|
||||||
qCritical("Failed to convert Entities to QVariantMap while saving to json.");
|
qCritical("Failed to convert Entities to QVariantMap while saving to json.");
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert the QVariantMap to JSON
|
// convert the QVariantMap to JSON
|
||||||
|
@ -1916,22 +1918,26 @@ void Octree::writeToJSONFile(const char* fileName, OctreeElementPointer element,
|
||||||
if (doGzip) {
|
if (doGzip) {
|
||||||
if (!gzip(jsonData, jsonDataForFile, -1)) {
|
if (!gzip(jsonData, jsonDataForFile, -1)) {
|
||||||
qCritical("unable to gzip data while saving to json.");
|
qCritical("unable to gzip data while saving to json.");
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
jsonDataForFile = jsonData;
|
jsonDataForFile = jsonData;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile persistFile(fileName);
|
QFile persistFile(fileName);
|
||||||
|
bool success = false;
|
||||||
if (persistFile.open(QIODevice::WriteOnly)) {
|
if (persistFile.open(QIODevice::WriteOnly)) {
|
||||||
persistFile.write(jsonDataForFile);
|
success = persistFile.write(jsonDataForFile) != -1;
|
||||||
} else {
|
} else {
|
||||||
qCritical("Could not write to JSON description of entities.");
|
qCritical("Could not write to JSON description of entities.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element) {
|
bool Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element) {
|
||||||
qWarning() << "SVO file format depricated. Support for reading SVO files is no longer support and will be removed soon.";
|
qWarning() << "SVO file format deprecated. Support for reading SVO files is no longer support and will be removed soon.";
|
||||||
|
bool success = false;
|
||||||
|
|
||||||
std::ofstream file(fileName, std::ios::out|std::ios::binary);
|
std::ofstream file(fileName, std::ios::out|std::ios::binary);
|
||||||
|
|
||||||
|
@ -2010,8 +2016,12 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element)
|
||||||
}
|
}
|
||||||
|
|
||||||
releaseSceneEncodeData(&extraEncodeData);
|
releaseSceneEncodeData(&extraEncodeData);
|
||||||
|
|
||||||
|
success = true;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long Octree::getOctreeElementsCount() {
|
unsigned long Octree::getOctreeElementsCount() {
|
||||||
|
|
|
@ -299,9 +299,9 @@ public:
|
||||||
void loadOctreeFile(const char* fileName);
|
void loadOctreeFile(const char* fileName);
|
||||||
|
|
||||||
// Octree exporters
|
// Octree exporters
|
||||||
void writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
bool writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
||||||
void writeToJSONFile(const char* filename, OctreeElementPointer element = NULL, bool doGzip = false);
|
bool writeToJSONFile(const char* filename, OctreeElementPointer element = NULL, bool doGzip = false);
|
||||||
void writeToSVOFile(const char* filename, OctreeElementPointer element = NULL);
|
bool writeToSVOFile(const char* filename, OctreeElementPointer element = NULL);
|
||||||
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues,
|
virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues,
|
||||||
bool skipThoseWithBadParents) = 0;
|
bool skipThoseWithBadParents) = 0;
|
||||||
|
|
||||||
|
|
|
@ -210,10 +210,6 @@ public:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void recommendedFramebufferSizeChanged(const QSize & size);
|
void recommendedFramebufferSizeChanged(const QSize & size);
|
||||||
// Indicates that this display plugin is no longer valid for use.
|
|
||||||
// For instance if a user exits Oculus Home or Steam VR while
|
|
||||||
// using the corresponding plugin, that plugin should be disabled.
|
|
||||||
void outputDeviceLost();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void incrementPresentCount();
|
void incrementPresentCount();
|
||||||
|
|
|
@ -96,7 +96,9 @@ bool Procedural::parseVersion(const QJsonValue& version) {
|
||||||
|
|
||||||
bool Procedural::parseUrl(const QUrl& shaderUrl) {
|
bool Procedural::parseUrl(const QUrl& shaderUrl) {
|
||||||
if (!shaderUrl.isValid()) {
|
if (!shaderUrl.isValid()) {
|
||||||
qWarning() << "Invalid shader URL: " << shaderUrl;
|
if (!shaderUrl.isEmpty()) {
|
||||||
|
qWarning() << "Invalid shader URL: " << shaderUrl;
|
||||||
|
}
|
||||||
_networkShader.reset();
|
_networkShader.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,12 +264,18 @@ float snoise(vec2 v) {
|
||||||
return 130.0 * dot(m, g);
|
return 130.0 * dot(m, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define PROCEDURAL 1
|
#define PROCEDURAL 1
|
||||||
|
|
||||||
//PROCEDURAL_VERSION
|
//PROCEDURAL_VERSION
|
||||||
|
|
||||||
#ifdef PROCEDURAL_V1
|
#ifdef PROCEDURAL_V1
|
||||||
|
|
||||||
|
// shader playback time (in seconds)
|
||||||
|
uniform float iGlobalTime;
|
||||||
|
// the dimensions of the object being rendered
|
||||||
|
uniform vec3 iWorldScale;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Unimplemented uniforms
|
// Unimplemented uniforms
|
||||||
|
|
5
libraries/steamworks-wrapper/CMakeLists.txt
Normal file
5
libraries/steamworks-wrapper/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
set(TARGET_NAME steamworks-wrapper)
|
||||||
|
setup_hifi_library()
|
||||||
|
link_hifi_libraries()
|
||||||
|
|
||||||
|
target_steamworks()
|
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// SteamClient.cpp
|
||||||
|
// steamworks-wrapper/src/steamworks-wrapper
|
||||||
|
//
|
||||||
|
// Created by Clement Brisset on 6/8/16.
|
||||||
|
// Copyright 2016 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 "SteamClient.h"
|
||||||
|
|
||||||
|
#include <steam/steam_api.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
//
|
||||||
|
// SteamClient.h
|
||||||
|
// steamworks-wrapper/src/steamworks-wrapper
|
||||||
|
//
|
||||||
|
// Created by Clement Brisset on 6/8/16.
|
||||||
|
// Copyright 2016 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_SteamClient_h
|
||||||
|
#define hifi_SteamClient_h
|
||||||
|
|
||||||
|
class SteamClient {
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_SteamClient_h
|
|
@ -134,10 +134,7 @@ void OpenVrDisplayPlugin::resetSensors() {
|
||||||
|
|
||||||
bool OpenVrDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
bool OpenVrDisplayPlugin::beginFrameRender(uint32_t frameIndex) {
|
||||||
handleOpenVrEvents();
|
handleOpenVrEvents();
|
||||||
if (openVrQuitRequested()) {
|
|
||||||
emit outputDeviceLost();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
double displayFrequency = _system->GetFloatTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_DisplayFrequency_Float);
|
double displayFrequency = _system->GetFloatTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_DisplayFrequency_Float);
|
||||||
double frameDuration = 1.f / displayFrequency;
|
double frameDuration = 1.f / displayFrequency;
|
||||||
double vsyncToPhotons = _system->GetFloatTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_SecondsFromVsyncToPhotons_Float);
|
double vsyncToPhotons = _system->GetFloatTrackedDeviceProperty(vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_SecondsFromVsyncToPhotons_Float);
|
||||||
|
|
|
@ -31,11 +31,6 @@ using Lock = std::unique_lock<Mutex>;
|
||||||
static int refCount { 0 };
|
static int refCount { 0 };
|
||||||
static Mutex mutex;
|
static Mutex mutex;
|
||||||
static vr::IVRSystem* activeHmd { nullptr };
|
static vr::IVRSystem* activeHmd { nullptr };
|
||||||
static bool _openVrQuitRequested { false };
|
|
||||||
|
|
||||||
bool openVrQuitRequested() {
|
|
||||||
return _openVrQuitRequested;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const uint32_t RELEASE_OPENVR_HMD_DELAY_MS = 5000;
|
static const uint32_t RELEASE_OPENVR_HMD_DELAY_MS = 5000;
|
||||||
|
|
||||||
|
@ -89,7 +84,6 @@ void releaseOpenVrSystem() {
|
||||||
if (0 == refCount) {
|
if (0 == refCount) {
|
||||||
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
||||||
vr::VR_Shutdown();
|
vr::VR_Shutdown();
|
||||||
_openVrQuitRequested = false;
|
|
||||||
activeHmd = nullptr;
|
activeHmd = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,8 +222,8 @@ void handleOpenVrEvents() {
|
||||||
while (activeHmd->PollNextEvent(&event, sizeof(event))) {
|
while (activeHmd->PollNextEvent(&event, sizeof(event))) {
|
||||||
switch (event.eventType) {
|
switch (event.eventType) {
|
||||||
case vr::VREvent_Quit:
|
case vr::VREvent_Quit:
|
||||||
_openVrQuitRequested = true;
|
|
||||||
activeHmd->AcknowledgeQuit_Exiting();
|
activeHmd->AcknowledgeQuit_Exiting();
|
||||||
|
QMetaObject::invokeMethod(qApp, "quit");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case vr::VREvent_KeyboardDone:
|
case vr::VREvent_KeyboardDone:
|
||||||
|
@ -244,7 +238,7 @@ void handleOpenVrEvents() {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
qDebug() << "OpenVR: Event " << event.eventType;
|
qDebug() << "OpenVR: Event " << activeHmd->GetEventTypeNameFromEnum((vr::EVREventType)event.eventType) << "(" << event.eventType << ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,10 +213,6 @@ void ViveControllerManager::renderHand(const controller::Pose& pose, gpu::Batch&
|
||||||
void ViveControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
void ViveControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) {
|
||||||
auto userInputMapper = DependencyManager::get<controller::UserInputMapper>();
|
auto userInputMapper = DependencyManager::get<controller::UserInputMapper>();
|
||||||
handleOpenVrEvents();
|
handleOpenVrEvents();
|
||||||
if (openVrQuitRequested()) {
|
|
||||||
deactivate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// because update mutates the internal state we need to lock
|
// because update mutates the internal state we need to lock
|
||||||
userInputMapper->withLock([&, this]() {
|
userInputMapper->withLock([&, this]() {
|
||||||
|
|
|
@ -671,7 +671,6 @@
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
for (var i = 0; i < elShapeSections.length; i++) {
|
for (var i = 0; i < elShapeSections.length; i++) {
|
||||||
console.log("Hiding shape section " + elShapeSections[i])
|
|
||||||
elShapeSections[i].style.display = 'none';
|
elShapeSections[i].style.display = 'none';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -805,8 +804,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var activeElement = document.activeElement;
|
var activeElement = document.activeElement;
|
||||||
|
|
||||||
activeElement.select();
|
if(typeof activeElement.select!=="undefined"){
|
||||||
|
activeElement.select();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -48,7 +48,7 @@ var selectedInputMenu = "";
|
||||||
var selectedOutputMenu = "";
|
var selectedOutputMenu = "";
|
||||||
|
|
||||||
function setupAudioMenus() {
|
function setupAudioMenus() {
|
||||||
Menu.addMenu("Audio > Devices", "Advanced");
|
Menu.addMenu("Audio > Devices");
|
||||||
Menu.addSeparator("Audio > Devices","Output Audio Device");
|
Menu.addSeparator("Audio > Devices","Output Audio Device");
|
||||||
|
|
||||||
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING);
|
||||||
|
|
|
@ -515,6 +515,20 @@ function maybeInstallDefaultContentSet(onComplete) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("Found contentPath:" + argv.contentPath);
|
||||||
|
if (argv.contentPath) {
|
||||||
|
fs.copy(argv.contentPath, getRootHifiDataDirectory(), function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.log('Could not copy home content: ' + err);
|
||||||
|
return console.error(err)
|
||||||
|
}
|
||||||
|
console.log('Copied home content over to: ' + getRootHifiDataDirectory());
|
||||||
|
onComplete();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Show popup
|
// Show popup
|
||||||
var window = new BrowserWindow({
|
var window = new BrowserWindow({
|
||||||
icon: appIcon,
|
icon: appIcon,
|
||||||
|
|
Loading…
Reference in a new issue