mirror of https://github.com/bjornbytes/lovr.git
Code cleanup after all these changes, fix build
This commit is contained in:
parent
dba6724915
commit
dd440b2ada
|
@ -18,6 +18,7 @@ option(LOVR_ENABLE_JSON "Bundle with lua-cjson" ON)
|
||||||
|
|
||||||
option(LOVR_USE_LUAJIT "Use LuaJIT instead of Lua" ON)
|
option(LOVR_USE_LUAJIT "Use LuaJIT instead of Lua" ON)
|
||||||
option(LOVR_USE_ASSIMP "Enable model loading with Assimp" ON)
|
option(LOVR_USE_ASSIMP "Enable model loading with Assimp" ON)
|
||||||
|
option(LOVR_USE_OPENVR "Enable the OpenVR backend for the headset module" ON)
|
||||||
option(LOVR_USE_WEBVR "Enable the WebVR backend for the headset module" OFF)
|
option(LOVR_USE_WEBVR "Enable the WebVR backend for the headset module" OFF)
|
||||||
option(LOVR_USE_OCULUS "Enable the LibOVR backend for the headset module (be sure to also set LOVR_OCULUS_PATH to point to the Oculus SDK)" OFF)
|
option(LOVR_USE_OCULUS "Enable the LibOVR backend for the headset module (be sure to also set LOVR_OCULUS_PATH to point to the Oculus SDK)" OFF)
|
||||||
option(LOVR_USE_OCULUS_MOBILE "Enable the Oculus Mobile (Android) backend for the headset module" OFF)
|
option(LOVR_USE_OCULUS_MOBILE "Enable the Oculus Mobile (Android) backend for the headset module" OFF)
|
||||||
|
@ -461,8 +462,6 @@ if(LOVR_ENABLE_HEADSET)
|
||||||
add_definitions(-DLOVR_USE_OCULUS_MOBILE)
|
add_definitions(-DLOVR_USE_OCULUS_MOBILE)
|
||||||
add_definitions(-DNO_WINDOW=1)
|
add_definitions(-DNO_WINDOW=1)
|
||||||
|
|
||||||
#add_definitions(-DLOVRAPP_LIBLOVR_INTERNAL_PATH=) # TODO?
|
|
||||||
|
|
||||||
# OCULUS_MOBILE assumes it will be built as part of an Android app, and that it is a git submodule of that app.
|
# OCULUS_MOBILE assumes it will be built as part of an Android app, and that it is a git submodule of that app.
|
||||||
# The "BridgeLovr" files live in the parent (app) repository:
|
# The "BridgeLovr" files live in the parent (app) repository:
|
||||||
include_directories(../include)
|
include_directories(../include)
|
||||||
|
@ -565,7 +564,7 @@ if(WIN32)
|
||||||
move_dll(${LOVR_GLFW})
|
move_dll(${LOVR_GLFW})
|
||||||
move_dll(${LOVR_LUA})
|
move_dll(${LOVR_LUA})
|
||||||
move_dll(${LOVR_ODE})
|
move_dll(${LOVR_ODE})
|
||||||
if (NOT LOVR_USE_OCULUS)
|
if (LOVR_USE_OPENVR)
|
||||||
move_dll(${LOVR_OPENVR})
|
move_dll(${LOVR_OPENVR})
|
||||||
endif()
|
endif()
|
||||||
move_dll(${LOVR_PHYSFS})
|
move_dll(${LOVR_PHYSFS})
|
||||||
|
|
|
@ -70,14 +70,11 @@ typedef struct {
|
||||||
|
|
||||||
static HeadsetRenderData headsetRenderData;
|
static HeadsetRenderData headsetRenderData;
|
||||||
|
|
||||||
#include <android/log.h>
|
|
||||||
|
|
||||||
static void renderHelper(void* userdata) {
|
static void renderHelper(void* userdata) {
|
||||||
HeadsetRenderData* renderData = userdata;
|
HeadsetRenderData* renderData = userdata;
|
||||||
lua_State* L = renderData->L;
|
lua_State* L = renderData->L;
|
||||||
#ifdef LOVR_HEADSET_HELPER_USES_REGISTRY
|
#ifdef LOVR_HEADSET_HELPER_USES_REGISTRY
|
||||||
lua_rawgeti(L, LUA_REGISTRYINDEX, renderData->ref);
|
lua_rawgeti(L, LUA_REGISTRYINDEX, renderData->ref);
|
||||||
__android_log_print(ANDROID_LOG_ERROR, "LOVR", "ON ANDROID PATH AS EXPECTED (%d) (%d,%d)", (int)renderData->ref, (int)lua_type(L, -1), (int)LUA_TFUNCTION);
|
|
||||||
#else
|
#else
|
||||||
lua_pushvalue(L, -1);
|
lua_pushvalue(L, -1);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
// These are stubs of necessary GLFW functions for platforms lacking GLFW, such as Oculus Mobile.
|
// These are stubs of necessary GLFW functions for platforms lacking GLFW, such as Oculus Mobile.
|
||||||
// All of Lovr will build with just these functions as long as you build with NO_WINDOW and omit fake.c.
|
// All of Lovr will build with just these functions as long as you build with NO_WINDOW and omit fake.c.
|
||||||
|
|
||||||
// TODO: Move to own header
|
|
||||||
typedef void GLFWwindow;
|
typedef void GLFWwindow;
|
||||||
#define GLFWAPI
|
#define GLFWAPI
|
||||||
|
#define GLFWAPI_IS_FAKE
|
||||||
GLFWAPI void glfwPollEvents();
|
GLFWAPI void glfwPollEvents();
|
||||||
GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
|
GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
|
||||||
GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
|
GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
|
||||||
|
|
|
@ -11,10 +11,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef LOVR_USE_OCULUS_MOBILE
|
|
||||||
#include <android/log.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_Thread_local lovrErrorHandler lovrErrorCallback = NULL;
|
_Thread_local lovrErrorHandler lovrErrorCallback = NULL;
|
||||||
_Thread_local void* lovrErrorUserdata = NULL;
|
_Thread_local void* lovrErrorUserdata = NULL;
|
||||||
|
|
Loading…
Reference in New Issue