I'm wondering about how one might integrate
Google Play Games Services into a Love2D project running with love-android-sdl2. I know Love2D comes with LuaJIT and FFI, so you can call native C functions like so
Code: Select all
local ffi = require("ffi")
ffi.cdef[[
int printf(const char *fmt, ...);
]]
ffi.C.printf("%s running on %s %s\n", jit.version, jit.os, jit.arch)
function love.load()
love.window.setMode( 120, 100 )
love.graphics.setBackgroundColor(80, 80, 80)
end
function love.draw()
love.graphics.printf("Check terminal...", 0, love.graphics.getHeight()/2 - 12, love.graphics.getWidth(), "center")
end
Not that this example is particularly useful, but you can see that we can execute C functions nicely. This all nice and dandy, but it doesn't seem to help for accessing Play Games APIs. They offer an API for Android, C++, and for Web via REST. So I'm thinking "How should I implement this?". Do I need a special Java/Android interface for Lua/Love2D? Perhaps a C++ interface would be better? Should I use LuaJIT FFI to call a C function which then uses JNI? Should I somehow use their REST API (I'm unsure of the limitations)?