mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
Merge remote-tracking branch 'origin/develop' into feature/launcherconfigs
This commit is contained in:
+30
-24
@@ -35,6 +35,7 @@
|
||||
|
||||
sgct::Engine* _sgctEngine;
|
||||
|
||||
int main_main(int argc, char** argv);
|
||||
void mainInitFunc();
|
||||
void mainPreSyncFunc();
|
||||
void mainPostSyncPreDrawFunc();
|
||||
@@ -82,6 +83,30 @@ namespace {
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
try {
|
||||
return main_main(argc, argv);
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC(e.component, e.message);
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC("Exception", e.what());
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
catch (...) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC("Exception", "Unknown exception");
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
int main_main(int argc, char** argv) {
|
||||
auto glVersion = supportedOpenGLVersion();
|
||||
|
||||
// create the OpenSpace engine and get arguments for the sgct engine
|
||||
@@ -99,8 +124,9 @@ int main(int argc, char** argv) {
|
||||
// create sgct engine c arguments
|
||||
int newArgc = static_cast<int>(sgctArguments.size());
|
||||
char** newArgv = new char*[newArgc];
|
||||
for (int i = 0; i < newArgc; ++i)
|
||||
for (int i = 0; i < newArgc; ++i) {
|
||||
newArgv[i] = const_cast<char*>(sgctArguments.at(i).c_str());
|
||||
}
|
||||
|
||||
// Need to set this before the creation of the sgct::Engine
|
||||
sgct::MessageHandler::instance()->setLogToConsole(false);
|
||||
@@ -168,29 +194,9 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
|
||||
// Main loop
|
||||
try {
|
||||
LDEBUG("Starting rendering loop");
|
||||
_sgctEngine->render();
|
||||
LDEBUG("Ending rendering loop");
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC(e.component, e.message);
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC("Exception", e.what());
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
catch (...) {
|
||||
// Write out all of the information about the exception, flush the logs, and throw
|
||||
LFATALC("Exception", "Unknown exception");
|
||||
LogMgr.flushLogs();
|
||||
throw;
|
||||
}
|
||||
LDEBUG("Starting rendering loop");
|
||||
_sgctEngine->render();
|
||||
LDEBUG("Ending rendering loop");
|
||||
|
||||
//clear function bindings to avoid crash after destroying the OpenSpace Engine
|
||||
sgct::MessageHandler::instance()->setLogToCallback(false);
|
||||
|
||||
+1
-1
Submodule ext/ghoul updated: 206bc2e499...c007df9d95
@@ -31,7 +31,7 @@
|
||||
namespace openspace {
|
||||
namespace globebrowsing {
|
||||
|
||||
class TileIndex;
|
||||
struct TileIndex;
|
||||
|
||||
class GeodeticPatch {
|
||||
public:
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <modules/globebrowsing/rendering/layer/layergroup.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <modules/debugging/rendering/debugrenderer.h>
|
||||
#include <modules/globebrowsing/tile/tileindex.h>
|
||||
|
||||
#include <openspace/util/time.h>
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace culling {
|
||||
class Chunk;
|
||||
class ChunkNode;
|
||||
class ChunkRenderer;
|
||||
class Geodetic2;
|
||||
struct Geodetic2;
|
||||
class LayerManager;
|
||||
class RenderableGlobe;
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class LayerRenderSettings;
|
||||
struct TileDepthTransform;
|
||||
struct TileUvTransform;
|
||||
|
||||
class LayerGroup;
|
||||
struct LayerGroup;
|
||||
struct TileIndex;
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace openspace {
|
||||
namespace globebrowsing {
|
||||
|
||||
class LayerGroup;
|
||||
struct LayerGroup;
|
||||
|
||||
/**
|
||||
* Manages multiple LayerGroups.
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <ghoul/glm.h>
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
|
||||
#include <cpl_error.h>
|
||||
|
||||
@@ -77,21 +77,6 @@ std::ostream& operator<<(std::ostream& os, const PixelRegion& pr) {
|
||||
return os << pr.start.x << ", " << pr.start.y << " with size " << pr.numPixels.x << ", " << pr.numPixels.y;
|
||||
}
|
||||
|
||||
TileDataLayout::TileDataLayout() {}
|
||||
|
||||
TileDataLayout::TileDataLayout(GDALDataset* dataSet, GLuint preferredGlType) {
|
||||
// Assume all raster bands have the same data type
|
||||
gdalType =preferredGlType != 0 ?
|
||||
tiledatatype::getGdalDataType(preferredGlType) :
|
||||
dataSet->GetRasterBand(1)->GetRasterDataType();
|
||||
|
||||
glType = tiledatatype::getOpenGLDataType(gdalType);
|
||||
numRasters = dataSet->GetRasterCount();
|
||||
bytesPerDatum = tiledatatype::numberOfBytes(gdalType);
|
||||
bytesPerPixel = bytesPerDatum * numRasters;
|
||||
textureFormat = tiledatatype::getTextureFormat(numRasters, gdalType);
|
||||
}
|
||||
|
||||
TileDataset::IODescription TileDataset::IODescription::cut(PixelRegion::Side side, int pos) {
|
||||
PixelRegion readPreCut = read.region;
|
||||
PixelRegion writePreCut = write.region;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ghoul {
|
||||
namespace openspace {
|
||||
namespace globebrowsing {
|
||||
|
||||
class Geodetic2;
|
||||
struct Geodetic2;
|
||||
|
||||
enum CardinalDirection {
|
||||
WEST = 0,
|
||||
|
||||
@@ -73,6 +73,7 @@ void ModuleEngine::registerModule(std::unique_ptr<OpenSpaceModule> module) {
|
||||
|
||||
LDEBUG("Registering module '" << module->name() << "'");
|
||||
module->initialize();
|
||||
LDEBUG("Registered module '" << module->name() << "'");
|
||||
_modules.push_back(std::move(module));
|
||||
}
|
||||
|
||||
|
||||
@@ -975,7 +975,9 @@ void OpenSpaceEngine::postSynchronizationPreDraw() {
|
||||
}
|
||||
|
||||
void OpenSpaceEngine::render(const glm::mat4& projectionMatrix, const glm::mat4& viewMatrix) {
|
||||
LTRACE("OpenSpaceEngine::render(begin)");
|
||||
_renderEngine->render(projectionMatrix, viewMatrix);
|
||||
LTRACE("OpenSpaceEngine::render(end)");
|
||||
}
|
||||
|
||||
void OpenSpaceEngine::postDraw() {
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace openspace {
|
||||
OpenSpaceModule::OpenSpaceModule(std::string name) {
|
||||
ghoul_assert(!name.empty(), "Name must not be empty");
|
||||
|
||||
setName(name);
|
||||
setName(std::move(name));
|
||||
}
|
||||
|
||||
void OpenSpaceModule::initialize() {
|
||||
@@ -77,8 +77,9 @@ std::string OpenSpaceModule::modulePath() const {
|
||||
std::string moduleName = name();
|
||||
std::transform(moduleName.begin(), moduleName.end(), moduleName.begin(), tolower);
|
||||
|
||||
if (FileSys.directoryExists("${MODULES}/" + moduleName))
|
||||
if (FileSys.directoryExists("${MODULES}/" + moduleName)) {
|
||||
return absPath("${MODULES}/" + moduleName);
|
||||
}
|
||||
|
||||
#ifdef EXTERNAL_MODULES_PATHS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user