Page 1 of 33

love-android-sdl2 (native, 0.9.2)

Posted: Tue Jan 14, 2014 8:47 am
by fysx
Hi everyone,

as some of you may have heard I have been tinkering with an native port. It is based on slime's fantastic GLES port and uses the 0.9.1 API. As it is a native port with only little code changed pretty much everything should work. However there is no guarantee but should "just work" most of the time.

The code is available here:

http://bitbucket.org/MartinFelis/love-android-sdl2

You can get the latest Android package from:

https://bitbucket.org/MartinFelis/love- ... /downloads

Current issues:

https://bitbucket.org/MartinFelis/love- ... tatus=open

Differences to the standard LÖVE:
* It uses GLES which requires different shaders and also the graphics module has a slightly different architecture than standard LÖVE on the engine side (but not API wise!). There might linger some hidden bugs there.
* love.system.getOS() returns "Android"
* features multitouch functions love.touchpressed (id,x,y,p), love.touchreleased (id, x, y, p), love.touchmoved (id, x, y, p)
* back button is assigned to the "escape" key
* text input: use love.keyboard.setTextInput(true) or set keyboard position using love.keyboard.setTextInput(enable, x, y, width, height)

Quickstart to get your game running
* Extract your game to /sdcard/lovegame such that main.lua is located at /sdcard/lovegame/main.lua.
* Run the app

Detailed instructions on packaging can be found here: https://bitbucket.org/MartinFelis/love- ... /wiki/Home

Some limitations:
* Requires at least Android 2.3.3

Enjoy!

Changelog:

0.9.2a (2015-04-10):
- Added slime's bugfix for ParticleSystem:clone

0.9.2 (2015-04-10):
- updated API to match that of LÖVE 0.9.2
- love.window.setFullscreen can be used to switch between regular and immersive mode without status and navbar
- added loading of games by opening a main.lua file
- quitting LÖVE now conforms to the Android application lifecycle
- stop vibrator when app is paused
- fixed battery drain by properly pausing OpenAL device
- fixed printing of non-number and non-string values
- fixed compilation of Android NDK r10
- fixed compilation warnings concerning APP_PLATFORM
- old instance is shut down when opening a new game (note: it may crash when opening games at a high frequency, e.g. more than 2 per second)
- updated OpenAL-Soft to version 1.16.0
- updated to newer SDL version (f9244b2a151)

0.9.1b:
- added love.system.vibrate(seconds)
- print statements are now redirected to logcat. Output is prefixed with "[LOVE] "
- removed SDL.log()
- removed DevIL, libpng, libjpeg, libmng, and libtiff
- PNGs are loaded using lodepng and JPEGs using libturbo-jpeg
- repeatedly fixed a bug which caused Release builds to crash
- update to latest mobile-common branch

0.9.1a:
- using latest SDL_androidgl.c (fixes some random performance issues)
- using latest love-android @ changeset 8659be0e75a3 (adds support for compressed textures)

0.9.1:
- uses 0.9.1 API
- fixed crash on Moto G (and possibly other devices). This was a nasty bug that would just show a blue screen without an error message. The bug was resolved using the help of headchant
- fixed loading of jpegs (it probably hasn't worked up to now)
- fixed issues with looping over active touches. This fix was sponsored by slime!

Older changelogs can be found at https://bitbucket.org/MartinFelis/love-android-sdl2/

(edit: 2015-04-10 update for 0.9.2)
(edit: 2014-01-20 update for alpha7)
(edit: 2014-01-30 update for alpha8)
(edit: 2014-02-09 update for alpha9)
(edit: 2014-02-11 update for beta1)
(edit: 2014-02-17 post cleanup)
(edit: 2014-02-23 update for beta2)
(edit: 2014-05-12 update for 0.9.1)
(edit: 2014-07-01 update for 0.9.1a)
(edit: 2015-04-10 update for 0.9.2)

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 12:31 pm
by Karai17
I've been testing this a bit over the last few weeks. It works pretty damn well! Awesome work, keep it up!

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 12:42 pm
by Fenrir
Great work! All modules are supposed to work ?

And how multitouch is working, did you add new callbacks ?

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 12:48 pm
by fysx
Fenrir wrote:Great work! All modules are supposed to work ?
Yes.
Fenrir wrote:And how multitouch is working, did you add new callbacks ?
Yes, Pavol Rusnak added code for that. The actual code at https://bitbucket.org/MartinFelis/love- ... ter#cl-173 should get you started.

Currently slime is working on a proper touch module. I will most likely to switch to that sooner or later.

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 12:49 pm
by jjmafiae
So it's now possible to release games for android? :O

Good job.

All hail the mighty linux systems!

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 1:20 pm
by SiENcE
Great! I'm looking forward to see the first love game on android store.

I hope to see it in the mainline of löve for 1.0 :).

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 2:06 pm
by T-Bone
Hole crepe, this looks great! I might actually release my game for Android too at some point now. I didn't think this day would come.

Too bad I don't use Android myself anymore though :P

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 2:22 pm
by jjmafiae
Im gonna buy a android phone now!!

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 6:33 pm
by Karai17

Re: love-android-sdl2 (native, 0.9.0)

Posted: Tue Jan 14, 2014 6:39 pm
by jjmafiae
I tested it on my little brother's adriod phone and the no game screen was fully working.

Also is love.mouse counting as the touch thing?