mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Updated OpenSpace to use the updated Ghoul ConfigurationManager
- Removed unnecessary comments from CMakeLists - Updated OpenSpace engine to load ConfigurationManager - Added two basic lua configuration scripts
This commit is contained in:
@@ -35,7 +35,7 @@ set(OPENSPACE_EXT_DIR "${OPENSPACE_BASE_DIR}/ext")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OPENSPACE_EXT_DIR})
|
||||
|
||||
# Make sure abuild type is set. Default is Debug.
|
||||
# Make sure a build type is set. Default is Debug.
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set( CMAKE_BUILD_TYPE Debug CACHE STRING
|
||||
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
|
||||
@@ -51,7 +51,6 @@ endif ()
|
||||
#########################################################################################
|
||||
|
||||
# Ghoul
|
||||
add_definitions(-DGHL_DEBUG)
|
||||
set(GHOUL_ROOT_DIR "${OPENSPACE_EXT_DIR}/ghoul")
|
||||
include_directories("${GHOUL_ROOT_DIR}/include")
|
||||
add_subdirectory(${GHOUL_ROOT_DIR})
|
||||
@@ -70,11 +69,6 @@ set(GLM_ROOT_DIR "${GHOUL_ROOT_DIR}/ext/glm")
|
||||
find_package(GLM REQUIRED)
|
||||
include_directories(${GLM_INCLUDE_DIRS})
|
||||
|
||||
# OpenGL
|
||||
#find_package(OpenGL REQUIRED)
|
||||
#include_directories(${OPENGL_INCLUDE_DIRS})
|
||||
#set(DEPENDENT_LIBS ${DEPENDENT_LIBS} ${OPENGL_LIBRARIES})
|
||||
|
||||
# GLEW
|
||||
find_package(GLEW REQUIRED)
|
||||
include_directories(${GLEW_INCLUDE_DIRECTORIES})
|
||||
@@ -83,8 +77,6 @@ set(DEPENDENT_LIBS ${DEPENDENT_LIBS} ${GLEW_LIBRARIES})
|
||||
# Lua
|
||||
set(LUA_ROOT_DIR "${GHOUL_ROOT_DIR}/ext/lua")
|
||||
include_directories("${LUA_ROOT_DIR}/include")
|
||||
#add_subdirectory(${LUA_ROOT_DIR})
|
||||
#set(DEPENDENT_LIBS ${DEPENDENT_LIBS} Lua)
|
||||
|
||||
# Spice
|
||||
set(SPICE_ROOT_DIR "${OPENSPACE_EXT_DIR}/spice")
|
||||
|
||||
@@ -130,19 +130,3 @@ else()
|
||||
MESSAGE(FATAL_ERROR "SGCT not found!")
|
||||
endif(SGCT_FOUND)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# OLD STUFF. REMOVE WHEN ABOVE WORKS
|
||||
#set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SGCT_ROOT_DOR}/bin/lib/msvc11)
|
||||
#set(DEPENDENT_LIBS
|
||||
# ${DEPENDENT_LIBS}
|
||||
# "Ws2_32.lib"
|
||||
# optimized "${SGCT_ROOT_DIR}/lib/msvc11_x64/sgct.lib"
|
||||
# debug "${SGCT_ROOT_DIR}/lib/msvc11_x64/sgctd.lib"
|
||||
# )
|
||||
|
||||
#add_subdirectory(${SGCT_ROOT_DIR})
|
||||
#set(DEPENDENT_LIBS ${DEPENDENT_LIBS} SGCT)
|
||||
|
||||
Submodule ext/ghoul updated: 9a8e9f1112...7cb0200c68
18
scripts/DefaultConfig.lua
Normal file
18
scripts/DefaultConfig.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
config =
|
||||
{
|
||||
level1_string = "music1",
|
||||
level1_integer = 2332,
|
||||
level1_dictionary =
|
||||
{
|
||||
level2_string = "stuff",
|
||||
level2_integer = 32,
|
||||
level2_dictionary = {
|
||||
level3_string = "levels",
|
||||
level3_integer = 323232
|
||||
}
|
||||
},
|
||||
level2_double = 3.4,
|
||||
level2_boolean = true
|
||||
|
||||
}
|
||||
14
scripts/ExtraConfig.lua
Normal file
14
scripts/ExtraConfig.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
configuration =
|
||||
{
|
||||
level1_string = "music2",
|
||||
level1_lyrics = "This is not, the greatest lyrics in the world. This is just a tribute",
|
||||
level1_secrets =
|
||||
{
|
||||
secret_stuff1 = "Password",
|
||||
secret_stuff2 = "123456",
|
||||
},
|
||||
level2_double = 4.3
|
||||
|
||||
}
|
||||
@@ -87,6 +87,7 @@ include_directories(${HEADER_ROOT_DIR})
|
||||
|
||||
# hack:
|
||||
set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${OPENSPACE_EXT_DIR}/tinythread.cpp)
|
||||
include_directories(${GHOUL_ROOT_DIR}/ext/boost)
|
||||
|
||||
if (APPLE)
|
||||
find_library(FRAMEWORK_IOKit
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
#include <ghoul/filesystem/filesystem>
|
||||
#include <ghoul/logging/logging>
|
||||
#include <ghoul/misc/configurationmanager.h>
|
||||
|
||||
using namespace ghoul::filesystem;
|
||||
using namespace ghoul::logging;
|
||||
@@ -80,7 +81,7 @@ void OpenSpaceEngine::create(int argc, char** argv, int& newArgc, char**& newArg
|
||||
assert(_engine == nullptr);
|
||||
_engine = new OpenSpaceEngine;
|
||||
|
||||
LogManager::initialize(LogManager::LogLevel::Debug);
|
||||
LogManager::initialize(LogManager::LogLevel::Debug, true);
|
||||
LogMgr.addLog(new ConsoleLog);
|
||||
|
||||
ghoul::filesystem::FileSystem::initialize();
|
||||
@@ -119,12 +120,13 @@ void OpenSpaceEngine::create(int argc, char** argv, int& newArgc, char**& newArg
|
||||
newArgv[2] = "../config/single.xml";
|
||||
#endif
|
||||
|
||||
// Load the configurationmanager with the default configuration
|
||||
ghoul::ConfigurationManager configuration;
|
||||
configuration.initialize(absPath("${SCRIPTS}/DefaultConfig.lua"));
|
||||
configuration.loadConfiguration(absPath("${SCRIPTS}/ExtraConfig.lua"));
|
||||
|
||||
|
||||
|
||||
|
||||
// Create the renderenginge object
|
||||
_engine->_renderEngine = new RenderEngine;
|
||||
|
||||
_engine->_interactionHandler = new InteractionHandler;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user