Add OpenSpace version information

Make info text in WaveFrontGeometry more useful
This commit is contained in:
Alexander Bock
2015-02-23 17:14:01 +01:00
parent 561e18d748
commit 3bf577d04d
3 changed files with 12 additions and 9 deletions

View File

@@ -28,6 +28,8 @@
set(SOURCE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(HEADER_ROOT_DIR ${CMAKE_SOURCE_DIR}/include)
set(OPENSPACE_HEADER ${OPENSPACE_HEADER} ${HEADER_ROOT_DIR}/openspace/version.h)
file(GLOB CONFIGURATION_SOURCE ${SOURCE_ROOT_DIR}/configuration/*.cpp)
set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${CONFIGURATION_SOURCE})
file(GLOB CONFIGURATION_HEADER ${HEADER_ROOT_DIR}/openspace/configuration/*.h)

View File

@@ -27,6 +27,7 @@
// sgct
#define SGCT_WINDOWS_INCLUDE
#include <sgct.h>
#include <openspace/version.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/logfactory.h>
@@ -186,6 +187,10 @@ bool OpenSpaceEngine::create(int argc, char** argv,
// Initialize the requested logs from the configuration file
_engine->configureLogging();
LINFOC("OpenSpace Version", OPENSPACE_VERSION_MAJOR << "." <<
OPENSPACE_VERSION_MINOR << "." <<
OPENSPACE_VERSION_BUILD << " (" << OPENSPACE_VERSION_STRING << ")");
// Create directories that doesn't exist
auto tokens = FileSys.tokens();
for (const std::string& token : tokens) {

View File

@@ -59,21 +59,17 @@ WavefrontGeometry::WavefrontGeometry(const ghoul::Dictionary& dictionary)
}
const std::string filename = FileSys.absolutePath(file);
std::ifstream ifile(filename.c_str());
if (ifile){
LDEBUG("Found file..\n");
ifile.close();
loadObj(filename.c_str());
}
else {
LERROR("Did not find file..\n");
}
if (FileSys.fileExists(filename))
loadObj(filename.c_str());
else
LERROR("Could not load OBJ file '" << filename << "': File not found");
}
void WavefrontGeometry::loadObj(const char *filename){
// temporary
const char *mtl_basepat = filename;
LINFO("Loading OBJ file '" << filename << "'");
std::string err = tinyobj::LoadObj(shapes, materials, filename, mtl_basepat);
LINFO("Loaded Mesh");