mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 12:39:24 -05:00
compile fixes in x64 builds
moved Lua dependency to Ghoul
This commit is contained in:
+1
-4
@@ -3,7 +3,4 @@
|
||||
url = git@openspace.itn.liu.se:ghoul
|
||||
[submodule "ext/spice"]
|
||||
path = ext/spice
|
||||
url = git@openspace.itn.liu.se:/spice
|
||||
[submodule "ext/lua"]
|
||||
path = ext/lua
|
||||
url = git@openspace.itn.liu.se:/lua
|
||||
url = git@openspace.itn.liu.se:/spice
|
||||
+12
-6
@@ -53,15 +53,21 @@ set(DEPENDENT_LIBS ${DEPENDENT_LIBS} Ghoul)
|
||||
# SGCT (TODO: write cmake script)
|
||||
#set(SGCT_ROOT_DIR "$ENV{SGCT_ROOT_DIR}")
|
||||
#set(SGCT_ROOT_DIR "C:/Program Files/SGCT/SGCT_2.0.7")
|
||||
set(SGCT_ROOT_DIR "C:/Program Files (x86)/SGCT/SGCT_2.0.5_x86")
|
||||
#set(SGCT_ROOT_DIR "C:/Program Files (x86)/SGCT/SGCT_2.0.5_x86")
|
||||
set(SGCT_ROOT_DIR "C:/Program Files/SGCT/SGCT_2.0.7")
|
||||
add_definitions(-D__WIN32__)
|
||||
include_directories("${SGCT_ROOT_DIR}/include")
|
||||
#set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SGCT_ROOT_DOR}/bin/lib/msvc11)
|
||||
set(DEPENDENT_LIBS
|
||||
${DEPENDENT_LIBS}
|
||||
optimized "${SGCT_ROOT_DIR}/lib/msvc11/sgct.lib"
|
||||
debug "${SGCT_ROOT_DIR}/lib/msvc11/sgctd.lib"
|
||||
"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)
|
||||
|
||||
# GLM
|
||||
set(GLM_ROOT_DIR "${GHOUL_ROOT_DIR}/ext/glm")
|
||||
find_package(GLM REQUIRED)
|
||||
@@ -78,10 +84,10 @@ include_directories(${GLM_INCLUDE_DIRS})
|
||||
#set(DEPENDENT_LIBS ${DEPENDENT_LIBS} ${GLEW_LIBRARIES})
|
||||
|
||||
# Lua
|
||||
set(LUA_ROOT_DIR "${OPENSPACE_EXT_DIR}/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)
|
||||
#add_subdirectory(${LUA_ROOT_DIR})
|
||||
#set(DEPENDENT_LIBS ${DEPENDENT_LIBS} Lua)
|
||||
|
||||
# Spice
|
||||
set(SPICE_ROOT_DIR "${OPENSPACE_EXT_DIR}/spice")
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" ?>
|
||||
<Cluster masterAddress="127.0.0.1">
|
||||
<Node address="127.0.0.1" port="20401">
|
||||
<Cluster masterAddress="localhost">
|
||||
<Node address="localhost" port="20401">
|
||||
<Window fullScreen="false">
|
||||
<!-- 16:9 aspect ratio -->
|
||||
<Size x="640" y="360" />
|
||||
|
||||
+1
-1
Submodule ext/ghoul updated: 874a5178a8...e391493a52
-1
Submodule ext/lua deleted from d00aacb598
+1
-1
@@ -44,7 +44,7 @@ file(GLOB SCENEGRAPH_SOURCE ${SOURCE_ROOT_DIR}/scenegraph/*.cpp)
|
||||
set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${SCENEGRAPH_SOURCE})
|
||||
file(GLOB SCENEGRAPH_HEADER ${HEADER_ROOT_DIR}/scenegraph/*.h)
|
||||
set(OPENSPACE_HEADER ${OPENSPACE_HEADER} ${SCENEGRAPH_HEADER})
|
||||
source_group(ExternalControl FILES ${SCENEGRAPH_SOURCE} ${SCENEGRAPH_HEADER})
|
||||
source_group(SceneGraph FILES ${SCENEGRAPH_SOURCE} ${SCENEGRAPH_HEADER})
|
||||
|
||||
file(GLOB UTIL_SOURCE ${SOURCE_ROOT_DIR}/util/*.cpp)
|
||||
set(OPENSPACE_SOURCE ${OPENSPACE_SOURCE} ${UTIL_SOURCE})
|
||||
|
||||
+108
-5
@@ -11,6 +11,10 @@
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
|
||||
#include <lua.hpp>
|
||||
#include <lstate.h>
|
||||
#include <chrono>
|
||||
|
||||
// graphics and openspace engines
|
||||
sgct::Engine * gEngine;
|
||||
openspace::RenderEngine *rEngine;
|
||||
@@ -28,13 +32,112 @@ void mainMouseScrollCallback(double posX, double posY);
|
||||
void mainEncodeFun();
|
||||
void mainDecodeFun();
|
||||
|
||||
/**
|
||||
* The main function, only purpose is to connect the
|
||||
* OpenSpace rendering engine with SGCT.
|
||||
*/
|
||||
void PrintTable(lua_State *L)
|
||||
{
|
||||
lua_pushnil(L);
|
||||
|
||||
while(lua_next(L, -2) != 0)
|
||||
{
|
||||
if(lua_isstring(L, -1))
|
||||
printf("%s = %s\n", lua_tostring(L, -2), lua_tostring(L, -1));
|
||||
else if(lua_isnumber(L, -1))
|
||||
printf("%s = %d\n", lua_tostring(L, -2), lua_tonumber(L, -1));
|
||||
else if(lua_istable(L, -1))
|
||||
PrintTable(L);
|
||||
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void stackDump (lua_State *L) {
|
||||
int i;
|
||||
int top = lua_gettop(L);
|
||||
for (i = 1; i <= top; i++) { /* repeat for each level */
|
||||
int t = lua_type(L, i);
|
||||
switch (t) {
|
||||
|
||||
case LUA_TSTRING: /* strings */
|
||||
printf("`%s'", lua_tostring(L, i));
|
||||
break;
|
||||
|
||||
case LUA_TBOOLEAN: /* booleans */
|
||||
printf(lua_toboolean(L, i) ? "true" : "false");
|
||||
break;
|
||||
|
||||
case LUA_TNUMBER: /* numbers */
|
||||
printf("%g", lua_tonumber(L, i));
|
||||
break;
|
||||
|
||||
case LUA_TTABLE:
|
||||
PrintTable(L);
|
||||
break;
|
||||
default: /* other values */
|
||||
printf("%s", lua_typename(L, t));
|
||||
break;
|
||||
|
||||
}
|
||||
printf(" "); /* put a separator */
|
||||
}
|
||||
printf("\n"); /* end the listing */
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
ghoul::filesystem::FileSystem::initialize();
|
||||
//FileSys.registerPathToken("${BASE_PATH}", "../../..");
|
||||
FileSys.registerPathToken("${BASE_PATH}", "../..");
|
||||
FileSys.registerPathToken("${SCRIPTS}", "${BASE_PATH}/scripts");
|
||||
|
||||
LARGE_INTEGER t1;
|
||||
QueryPerformanceCounter(&t1);
|
||||
lua_State* l = luaL_newstate();
|
||||
LARGE_INTEGER t2;
|
||||
QueryPerformanceCounter(&t2);
|
||||
|
||||
luaL_openlibs(l);
|
||||
LARGE_INTEGER t3;
|
||||
QueryPerformanceCounter(&t3);
|
||||
if (luaL_loadfile(l, p("${SCRIPTS}/script.lua").c_str())) {
|
||||
std::cerr << lua_tostring(l, -1) << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
LARGE_INTEGER t4;
|
||||
QueryPerformanceCounter(&t4);
|
||||
|
||||
if (lua_pcall(l,0, LUA_MULTRET, 0)) {
|
||||
std::cerr << lua_tostring(l, -1) << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
LARGE_INTEGER t5;
|
||||
QueryPerformanceCounter(&t5);
|
||||
|
||||
stackDump(l);
|
||||
|
||||
lua_getglobal(l, "t");
|
||||
std::cout << lua_istable(l, -1) << std::endl;
|
||||
|
||||
stackDump(l);
|
||||
|
||||
|
||||
|
||||
lua_close(l);
|
||||
LARGE_INTEGER t6;
|
||||
QueryPerformanceCounter(&t6);
|
||||
|
||||
|
||||
|
||||
|
||||
// --------
|
||||
LARGE_INTEGER freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
|
||||
std::cout << "State: " << ((t2.QuadPart - t1.QuadPart) / double(freq.QuadPart)) * 1000 << std::endl;
|
||||
std::cout << "Libs : " << ((t3.QuadPart - t2.QuadPart) / double(freq.QuadPart)) * 1000 << std::endl;
|
||||
std::cout << "Load : " << ((t4.QuadPart - t3.QuadPart) / double(freq.QuadPart)) * 1000 << std::endl;
|
||||
std::cout << "Exec : " << ((t5.QuadPart - t4.QuadPart) / double(freq.QuadPart)) * 1000 << std::endl;
|
||||
std::cout << "Close: " << ((t6.QuadPart - t5.QuadPart) / double(freq.QuadPart)) * 1000 << std::endl;
|
||||
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
char* cmd = "-config";
|
||||
const std::string pathStr = p("${BASE_PATH}/config/single.xml");
|
||||
@@ -69,7 +172,7 @@ int main(int argc, char **argv) {
|
||||
sgct::SharedData::instance()->setDecodeFunction(mainDecodeFun);
|
||||
|
||||
// try to open a window
|
||||
if( ! gEngine->init(sgct::Engine::OpenGL_4_4_Core_Profile)) {
|
||||
if( ! gEngine->init(sgct::Engine::OpenGL_4_0_Core_Profile)) {
|
||||
|
||||
// could not open a window, deallocates and exits
|
||||
delete gEngine;
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace {
|
||||
const double k = 10.0;
|
||||
}
|
||||
|
||||
psc::psc() {
|
||||
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
namespace openspace
|
||||
{
|
||||
|
||||
#define k 10.0
|
||||
|
||||
// forward declare the power scaled scalars
|
||||
class pss;
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace {
|
||||
const double k = 10.0;
|
||||
}
|
||||
|
||||
|
||||
pss::pss() {
|
||||
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
namespace openspace
|
||||
{
|
||||
|
||||
#define k 10.0
|
||||
|
||||
// forward declare the power scaled coordinates
|
||||
class psc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user