mirror of https://github.com/bjornbytes/lovr.git
Fix Android compile
This commit is contained in:
parent
961bf859f6
commit
99026af5ca
|
@ -1,5 +1,6 @@
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
#include "sds.h"
|
#include "lib/sds/sds.h"
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
static int l_lovrGetApplicationId(lua_State *L) {
|
static int l_lovrGetApplicationId(lua_State *L) {
|
||||||
pid_t pid = getpid();
|
pid_t pid = getpid();
|
||||||
|
@ -10,7 +11,7 @@ static int l_lovrGetApplicationId(lua_State *L) {
|
||||||
sds procData = sdsempty();
|
sds procData = sdsempty();
|
||||||
char data[64];
|
char data[64];
|
||||||
int read;
|
int read;
|
||||||
while (read = fread(data, sizeof(data), 1, procFile)) {
|
while ((read = fread(data, sizeof(data), 1, procFile))) {
|
||||||
procData = sdscatlen(procData, data, read);
|
procData = sdscatlen(procData, data, read);
|
||||||
}
|
}
|
||||||
sdsfree(procData);
|
sdsfree(procData);
|
||||||
|
@ -22,7 +23,7 @@ static int l_lovrGetApplicationId(lua_State *L) {
|
||||||
|
|
||||||
static const luaL_Reg lovrAndroid[] = {
|
static const luaL_Reg lovrAndroid[] = {
|
||||||
{ "getApplicationId", l_lovrGetApplicationId },
|
{ "getApplicationId", l_lovrGetApplicationId },
|
||||||
}
|
};
|
||||||
|
|
||||||
LOVR_API int luaopen_lovr_android(lua_State* L) {
|
LOVR_API int luaopen_lovr_android(lua_State* L) {
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#include "headset/headset.h"
|
#include "headset/headset.h"
|
||||||
#include "oculus_mobile_bridge.h"
|
#include "oculus_mobile_bridge.h"
|
||||||
#include "math/quat.h"
|
#include "math.h"
|
||||||
#include "graphics/graphics.h"
|
#include "graphics/graphics.h"
|
||||||
#include "math/mat4.h"
|
|
||||||
#include "lib/glad/glad.h"
|
#include "lib/glad/glad.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
|
@ -76,3 +76,7 @@ void lovrSleep(double seconds) {
|
||||||
int lovrGetExecutablePath(char* dest, uint32_t size) {
|
int lovrGetExecutablePath(char* dest, uint32_t size) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
#include <EGL/eglext.h>
|
||||||
|
getProcAddressProc lovrGetProcAddress = eglGetProcAddress;
|
Loading…
Reference in New Issue