Fix compilation issues and bugs on windows

This commit is contained in:
Emil Axelsson
2017-12-18 10:22:42 +01:00
parent 570a499a59
commit fd550fc372
4 changed files with 11 additions and 5 deletions

View File

@@ -40,6 +40,7 @@
#include <openspace/scripting/scriptengine.h>
#include <openspace/rendering/renderable.h>
#include <openspace/rendering/dashboarditem.h>
#include <openspace/util/progressbar.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/engine/configurationmanager.h>
@@ -150,6 +151,10 @@ int main(int argc, char** argv) {
std::make_unique<ghoul::TemplateFactory<ResourceSynchronization>>(),
"ResourceSynchronization"
);
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<DashboardItem>>(),
"DashboardItem"
);
openspace::ConfigurationManager configuration;
@@ -181,7 +186,7 @@ int main(int argc, char** argv) {
std::string tasksPath = "";
commandlineParser.addCommand(
std::make_unique<ghoul::cmdparser::SingleCommand<std::string>>(
&tasksPath,
tasksPath,
"--task",
"-t",
"Provides the path to a task file to execute"

View File

@@ -30,6 +30,7 @@
#include <ghoul/glm.h>
#include <ghoul/misc/boolean.h>
#include <atomic>
#include <functional>
#include <memory>
#include <string>

View File

@@ -27,7 +27,7 @@
#include <openspace/scene/scenegraphnode.h>
#include <ghoul/misc/threadpool.h>
#include <openspace/util/threadpool.h>
#include <mutex>
@@ -55,7 +55,7 @@ public:
std::vector<SceneGraphNode*> getInitializedNodes() override;
private:
std::vector<SceneGraphNode*> _initializedNodes;
ghoul::ThreadPool _threadPool;
ThreadPool _threadPool;
std::mutex _mutex;
};

View File

@@ -47,7 +47,7 @@ MultiThreadedSceneInitializer::MultiThreadedSceneInitializer(unsigned int nThrea
{}
void MultiThreadedSceneInitializer::initializeNode(SceneGraphNode* node) {
auto initFunction = [this](SceneGraphNode* node) {
auto initFunction = [this, node]() {
node->initialize();
std::lock_guard<std::mutex> g(_mutex);
LDEBUG("Thread Initialized " << node->name());
@@ -55,7 +55,7 @@ void MultiThreadedSceneInitializer::initializeNode(SceneGraphNode* node) {
};
std::lock_guard<std::mutex> g(_mutex);
_threadPool.queue(initFunction, node);
_threadPool.enqueue(initFunction);
node->initialize();
}