Search found 36 matches

by Iori Branford
Wed Jul 20, 2016 12:13 am
Forum: Support and Development
Topic: Can I make ffi.load error nonfatal?
Replies: 2
Views: 1598

Re: Can I make ffi.load error nonfatal?

slime wrote:You can use pcall.

Code: Select all

local status, lib = pcall(ffi.load, "mylibrary")
if status then
    lib.foo(bar)
end
Thanks slime. Works for me.
by Iori Branford
Mon Jul 18, 2016 9:48 pm
Forum: Support and Development
Topic: Can I make ffi.load error nonfatal?
Replies: 2
Views: 1598

Can I make ffi.load error nonfatal?

My project uses an external library that I want to make optional. If it can't load, I would like to continue on without using it rather than halt the program. Can I do this?

I can't just disable the LOVE error handler - that only makes it close the window rather than show the blue error screen.
by Iori Branford
Mon Jun 27, 2016 6:43 pm
Forum: Support and Development
Topic: ffi.load can't find a library on some Android devices
Replies: 2
Views: 3908

Re: ffi.load can't find a library on some Android devices

Solved, by preloading the library in the GameActivity. public class MyGameActivity extends GameActivity { @Override protected String[] getLibraries() { String[] base = super.getLibraries(); final String[] mine = { "gme" }; String[] libs = new String[base.length + mine.length]; System.array...
by Iori Branford
Mon Jun 27, 2016 6:16 pm
Forum: Support and Development
Topic: ffi.load can't find a library on some Android devices
Replies: 2
Views: 3908

ffi.load can't find a library on some Android devices

I wish to use the game-music-emu library in a Love game by building it and exposing it with FFI. See MusicEmu.lua in gmetest.love. For Android, this means building the library into the Love Android app. I added the gme code into the jni directory along with a simple Android.mk. LOCAL_PATH := $(call ...
by Iori Branford
Fri Apr 15, 2016 1:56 pm
Forum: Support and Development
Topic: How to make shaders Android-friendly?
Replies: 1
Views: 2009

Re: How to make shaders Android-friendly?

I fixed it. I need to specify float precision on mobile.

Code: Select all

#ifdef GL_ES 
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif
by Iori Branford
Wed Apr 13, 2016 5:51 pm
Forum: Support and Development
Topic: How to make shaders Android-friendly?
Replies: 1
Views: 2009

How to make shaders Android-friendly?

In my stealth side scroller prototype I'm trying a spotlight shader for a simple darkness effect. On PCs it has the desired effect. 2883059318-screenshot04.png On Android devices it varies. For example, on Samsung Galaxy Note 5 the effect is much reduced. Enabling gamma-correct mode and/or high-DPI ...