Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThirdParty iOS Dependencies #144

Open
thejustinwalsh opened this issue May 8, 2018 · 34 comments
Open

ThirdParty iOS Dependencies #144

thejustinwalsh opened this issue May 8, 2018 · 34 comments

Comments

@thejustinwalsh
Copy link

thejustinwalsh commented May 8, 2018

I am working on building all third party dependencies for iOS, so might as well start this thread as I see one for android all ready open.

Working

libsdl2: Official Distro has an Xcode project, that will generate libSDL2.a

libpng: Built from source in project w/ preprocessor macros

PNG_NO_CONFIG_H
PNG_ARM_NEON_OPT=0
HAVE_DLFCN_H=1
HAVE_INTTYPES_H=1
HAVE_LIBZ=1
HAVE_MEMORY_H=1
HAVE_MEMSET=1
HAVE_POW=1
HAVE_STDINT_H=1
HAVE_STDLIB_H=1
HAVE_STRINGS_H=1
HAVE_STRING_H=1
HAVE_SYS_STAT_H=1
HAVE_SYS_TYPES_H=1
HAVE_UNISTD_H=1
STDC_HEADERS=1

pcre: Included source in project

libz: Included in iPhoneSDK as libz.tbd

libsqlite3: Included in iPhoneSDK as libdqlite3.tbd

libturbo-jpeg: https://libjpeg-turbo.org/Documentation/OfficialBinaries
Installed dmg, then linked against the library that is installed in /opt/libjpeg-turb/**, the resulting dylib path is not relative to the application binary, so instead using this static version found here (https://github.com/hjeffrey/turbojpeg) BITCODE is not enabled though... ☹️

Ogg: https://github.com/iosdevzone/IDZPrecompiledOgg
Vorbis: https://github.com/iosdevzone/IDZPrecompiledVorbis
Link to the included Frameworks in these repositories

OpenAL: Link against the OpenAL.framework in the iphone SDK.
Ensure you pass -L hlopenal when generating your c source with hl
Patch EFX.hx to just provide empty stubs

TODO

libturbo-jpeg: Need to find build a fat-binary with BITCODE enabled.

mbedtls: ???

ffmpeg: https://github.com/kewlbear/FFmpeg-iOS-build-script

General Setup

  • Use the Xcode Project Template included with SDL2 for iOS
  • Add hashlink src and hashlink library source (*.hdll source) to project
  • Add hl output src from my heaps project
  • Add pcre source to project
  • Edit System Header Search Paths to something like..
$SRCROOT/src
$SRCROOT/deps/hashlink/src
$SRCROOT/deps/hashlink/include/png
$SRCROOT/deps/hashlink/include/pcre
$SRCROOT/deps/SDL/include
$SRCROOT/deps/hashlink/libs/sdl
$SRCROOT/deps/hashlink/libs/openal
/opt/libjpeg-turbo/include

Once this is all wrangled setting up a CocoaPod that resolves all dependencies for hashlink could be pretty slick. Thoughts?

@ncannasse
Copy link
Member

Ping @rtissera

@ncannasse
Copy link
Member

PS: ffmpeg is only experimental video support and requires extra license compliance, see https://www.ffmpeg.org/legal.html

And OpenSSL should not be required, as we use mbedtls for SSL support

@rtissera
Copy link
Contributor

rtissera commented May 8, 2018 via email

@thejustinwalsh
Copy link
Author

Yeah I noticed the LGPL on OpenAL Soft.
Does there need to be a switch in hashlink when generating the source to not use the EFX bindings?

I noticed the bindings themselves are wrapped in #if ALC_EXT_EFX, however the hl code generation was assuming that it would be available regardless, or I miss configured something.

@thejustinwalsh
Copy link
Author

thejustinwalsh commented May 12, 2018

Still haven't managed to switch off EFX or get anything compiling against OpenAL.
My first approach was to modify heaps and instead of exporting class EFX just give it stubbed implementation instead. I am still getting references in functions.c to a bunch of openal functions that the linker can not find, (since ALC_EXT_EFX is off when compiling the openal stuff in hashlink.

@rtissera Any pointers you can share?

@thejustinwalsh
Copy link
Author

Posted too soon, I was generating the src into the wrong location. Here is the EFX hack, that I think could be put behind a compile time constant pretty easily...

package openal;
import openal.AL;

abstract Effect(Int) {
	public inline function toInt() : Int { return this; }
	public static inline function ofInt( v : Int ) : Effect { return cast v; }
}

abstract Filter(Int) {
	public inline function toInt() : Int { return this; }
	public static inline function ofInt( v : Int ) : Filter { return cast v; }
}

abstract EffectSlot(Int) {
	public inline function toInt() : Int { return this; }
	public static inline function ofInt( v : Int ) : EffectSlot { return cast v; }
}

// ------------------------------------------------------------------------
// ALC_EXT_EFX
// ------------------------------------------------------------------------

//@:hlNative("openal","al_")
class EFX {
	// Device attributes
	public static inline var EFX_MAJOR_VERSION                     = 0x20001;
	public static inline var EFX_MINOR_VERSION                     = 0x20002;
	public static inline var MAX_AUXILIARY_SENDS                   = 0x20003;

	// Listener properties.
	public static inline var METERS_PER_UNIT                       = 0x20004;

	// Source properties.
	public static inline var DIRECT_FILTER                         = 0x20005;
	public static inline var AUXILIARY_SEND_FILTER                 = 0x20006;
	public static inline var AIR_ABSORPTION_FACTOR                 = 0x20007;
	public static inline var ROOM_ROLLOFF_FACTOR                   = 0x20008;
	public static inline var CONE_OUTER_GAINHF                     = 0x20009;
	public static inline var DIRECT_FILTER_GAINHF_AUTO             = 0x2000A;
	public static inline var AUXILIARY_SEND_FILTER_GAIN_AUTO       = 0x2000B;
	public static inline var AUXILIARY_SEND_FILTER_GAINHF_AUTO     = 0x2000C;


	// Effect properties.

	// Reverb effect parameters
	public static inline var REVERB_DENSITY                        = 0x0001;
	public static inline var REVERB_DIFFUSION                      = 0x0002;
	public static inline var REVERB_GAIN                           = 0x0003;
	public static inline var REVERB_GAINHF                         = 0x0004;
	public static inline var REVERB_DECAY_TIME                     = 0x0005;
	public static inline var REVERB_DECAY_HFRATIO                  = 0x0006;
	public static inline var REVERB_REFLECTIONS_GAIN               = 0x0007;
	public static inline var REVERB_REFLECTIONS_DELAY              = 0x0008;
	public static inline var REVERB_LATE_REVERB_GAIN               = 0x0009;
	public static inline var REVERB_LATE_REVERB_DELAY              = 0x000A;
	public static inline var REVERB_AIR_ABSORPTION_GAINHF          = 0x000B;
	public static inline var REVERB_ROOM_ROLLOFF_FACTOR            = 0x000C;
	public static inline var REVERB_DECAY_HFLIMIT                  = 0x000D;

	// EAX Reverb effect parameters
	public static inline var EAXREVERB_DENSITY                     = 0x0001;
	public static inline var EAXREVERB_DIFFUSION                   = 0x0002;
	public static inline var EAXREVERB_GAIN                        = 0x0003;
	public static inline var EAXREVERB_GAINHF                      = 0x0004;
	public static inline var EAXREVERB_GAINLF                      = 0x0005;
	public static inline var EAXREVERB_DECAY_TIME                  = 0x0006;
	public static inline var EAXREVERB_DECAY_HFRATIO               = 0x0007;
	public static inline var EAXREVERB_DECAY_LFRATIO               = 0x0008;
	public static inline var EAXREVERB_REFLECTIONS_GAIN            = 0x0009;
	public static inline var EAXREVERB_REFLECTIONS_DELAY           = 0x000A;
	public static inline var EAXREVERB_REFLECTIONS_PAN             = 0x000B;
	public static inline var EAXREVERB_LATE_REVERB_GAIN            = 0x000C;
	public static inline var EAXREVERB_LATE_REVERB_DELAY           = 0x000D;
	public static inline var EAXREVERB_LATE_REVERB_PAN             = 0x000E;
	public static inline var EAXREVERB_ECHO_TIME                   = 0x000F;
	public static inline var EAXREVERB_ECHO_DEPTH                  = 0x0010;
	public static inline var EAXREVERB_MODULATION_TIME             = 0x0011;
	public static inline var EAXREVERB_MODULATION_DEPTH            = 0x0012;
	public static inline var EAXREVERB_AIR_ABSORPTION_GAINHF       = 0x0013;
	public static inline var EAXREVERB_HFREFERENCE                 = 0x0014;
	public static inline var EAXREVERB_LFREFERENCE                 = 0x0015;
	public static inline var EAXREVERB_ROOM_ROLLOFF_FACTOR         = 0x0016;
	public static inline var EAXREVERB_DECAY_HFLIMIT               = 0x0017;

	// Chorus effect parameters
	public static inline var CHORUS_WAVEFORM                       = 0x0001;
	public static inline var CHORUS_PHASE                          = 0x0002;
	public static inline var CHORUS_RATE                           = 0x0003;
	public static inline var CHORUS_DEPTH                          = 0x0004;
	public static inline var CHORUS_FEEDBACK                       = 0x0005;
	public static inline var CHORUS_DELAY                          = 0x0006;

	// Distortion effect parameters
	public static inline var DISTORTION_EDGE                       = 0x0001;
	public static inline var DISTORTION_GAIN                       = 0x0002;
	public static inline var DISTORTION_LOWPASS_CUTOFF             = 0x0003;
	public static inline var DISTORTION_EQCENTER                   = 0x0004;
	public static inline var DISTORTION_EQBANDWIDTH                = 0x0005;

	// Echo effect parameters
	public static inline var ECHO_DELAY                            = 0x0001;
	public static inline var ECHO_LRDELAY                          = 0x0002;
	public static inline var ECHO_DAMPING                          = 0x0003;
	public static inline var ECHO_FEEDBACK                         = 0x0004;
	public static inline var ECHO_SPREAD                           = 0x0005;

	// Flanger effect parameters
	public static inline var FLANGER_WAVEFORM                      = 0x0001;
	public static inline var FLANGER_PHASE                         = 0x0002;
	public static inline var FLANGER_RATE                          = 0x0003;
	public static inline var FLANGER_DEPTH                         = 0x0004;
	public static inline var FLANGER_FEEDBACK                      = 0x0005;
	public static inline var FLANGER_DELAY                         = 0x0006;

	// Frequency shifter effect parameters
	public static inline var FREQUENCY_SHIFTER_FREQUENCY           = 0x0001;
	public static inline var FREQUENCY_SHIFTER_LEFT_DIRECTION      = 0x0002;
	public static inline var FREQUENCY_SHIFTER_RIGHT_DIRECTION     = 0x0003;

	// Vocal morpher effect parameters
	public static inline var VOCAL_MORPHER_PHONEMEA                = 0x0001;
	public static inline var VOCAL_MORPHER_PHONEMEA_COARSE_TUNING  = 0x0002;
	public static inline var VOCAL_MORPHER_PHONEMEB                = 0x0003;
	public static inline var VOCAL_MORPHER_PHONEMEB_COARSE_TUNING  = 0x0004;
	public static inline var VOCAL_MORPHER_WAVEFORM                = 0x0005;
	public static inline var VOCAL_MORPHER_RATE                    = 0x0006;

	// Pitchshifter effect parameters
	public static inline var PITCH_SHIFTER_COARSE_TUNE             = 0x0001;
	public static inline var PITCH_SHIFTER_FINE_TUNE               = 0x0002;

	// Ringmodulator effect parameters
	public static inline var RING_MODULATOR_FREQUENCY              = 0x0001;
	public static inline var RING_MODULATOR_HIGHPASS_CUTOFF        = 0x0002;
	public static inline var RING_MODULATOR_WAVEFORM               = 0x0003;

	// Autowah effect parameters
	public static inline var AUTOWAH_ATTACK_TIME                   = 0x0001;
	public static inline var AUTOWAH_RELEASE_TIME                  = 0x0002;
	public static inline var AUTOWAH_RESONANCE                     = 0x0003;
	public static inline var AUTOWAH_PEAK_GAIN                     = 0x0004;

	// Compressor effect parameters
	public static inline var COMPRESSOR_ONOFF                      = 0x0001;

	// Equalizer effect parameters
	public static inline var EQUALIZER_LOW_GAIN                    = 0x0001;
	public static inline var EQUALIZER_LOW_CUTOFF                  = 0x0002;
	public static inline var EQUALIZER_MID1_GAIN                   = 0x0003;
	public static inline var EQUALIZER_MID1_CENTER                 = 0x0004;
	public static inline var EQUALIZER_MID1_WIDTH                  = 0x0005;
	public static inline var EQUALIZER_MID2_GAIN                   = 0x0006;
	public static inline var EQUALIZER_MID2_CENTER                 = 0x0007;
	public static inline var EQUALIZER_MID2_WIDTH                  = 0x0008;
	public static inline var EQUALIZER_HIGH_GAIN                   = 0x0009;
	public static inline var EQUALIZER_HIGH_CUTOFF                 = 0x000A;

	// Effect type
	public static inline var EFFECT_FIRST_PARAMETER                = 0x0000;
	public static inline var EFFECT_LAST_PARAMETER                 = 0x8000;
	public static inline var EFFECT_TYPE                           = 0x8001;

	// Effect types, used with the AL_EFFECT_TYPE property
	public static inline var EFFECT_NULL                           = 0x0000;
	public static inline var EFFECT_REVERB                         = 0x0001;
	public static inline var EFFECT_CHORUS                         = 0x0002;
	public static inline var EFFECT_DISTORTION                     = 0x0003;
	public static inline var EFFECT_ECHO                           = 0x0004;
	public static inline var EFFECT_FLANGER                        = 0x0005;
	public static inline var EFFECT_FREQUENCY_SHIFTER              = 0x0006;
	public static inline var EFFECT_VOCAL_MORPHER                  = 0x0007;
	public static inline var EFFECT_PITCH_SHIFTER                  = 0x0008;
	public static inline var EFFECT_RING_MODULATOR                 = 0x0009;
	public static inline var EFFECT_AUTOWAH                        = 0x000A;
	public static inline var EFFECT_COMPRESSOR                     = 0x000B;
	public static inline var EFFECT_EQUALIZER                      = 0x000C;
	public static inline var EFFECT_EAXREVERB                      = 0x8000;

	// Auxiliary Effect Slot properties.
	public static inline var EFFECTSLOT_EFFECT                     = 0x0001;
	public static inline var EFFECTSLOT_GAIN                       = 0x0002;
	public static inline var EFFECTSLOT_AUXILIARY_SEND_AUTO        = 0x0003;

	// NULL Auxiliary Slot ID to disable a source send.
	public static inline var EFFECTSLOT_NULL                       = 0x0000;


	// Filter properties.

	// Lowpass filter parameters
	public static inline var LOWPASS_GAIN                          = 0x0001;
	public static inline var LOWPASS_GAINHF                        = 0x0002;

	// Highpass filter parameters
	public static inline var HIGHPASS_GAIN                         = 0x0001;
	public static inline var HIGHPASS_GAINLF                       = 0x0002;

	// Bandpass filter parameters
	public static inline var BANDPASS_GAIN                         = 0x0001;
	public static inline var BANDPASS_GAINLF                       = 0x0002;
	public static inline var BANDPASS_GAINHF                       = 0x0003;

	// Filter type
	public static inline var FILTER_FIRST_PARAMETER                = 0x0000;
	public static inline var FILTER_LAST_PARAMETER                 = 0x8000;
	public static inline var FILTER_TYPE                           = 0x8001;

	// Filter types, used with the AL_FILTER_TYPE property
	public static inline var FILTER_NULL                           = 0x0000;
	public static inline var FILTER_LOWPASS                        = 0x0001;
	public static inline var FILTER_HIGHPASS                       = 0x0002;
	public static inline var FILTER_BANDPASS                       = 0x0003;

	public static function genEffects    (n : Int, effects : hl.Bytes) : Void { }
	public static function deleteEffects (n : Int, effects : hl.Bytes) : Void { }
	public static function isEffect      (effect : Effect) : Bool { return false; }
	public static function effecti       (effect : Effect, param : Int, iValue    : Int)      : Void { }
	public static function effectiv      (effect : Effect, param : Int, piValues  : hl.Bytes) : Void { }
	public static function effectf       (effect : Effect, param : Int, flValue   : hl.F32)   : Void { }
	public static function effectfv      (effect : Effect, param : Int, pflValues : hl.Bytes) : Void { }
	public static function getEffecti    (effect : Effect, param : Int)                       : Int { return 0; }
	public static function getEffectiv   (effect : Effect, param : Int, piValues  : hl.Bytes) : Void { };
	public static function getEffectf    (effect : Effect, param : Int)                       : hl.F32 { return 0; }
	public static function getEffectfv   (effect : Effect, param : Int, pflValues : hl.Bytes) : Void { }

	public static function genFilters    (n : Int, filters : hl.Bytes) : Void { }
	public static function deleteFilters (n : Int, filters : hl.Bytes) : Void { }
	public static function isFilter      (filter : Filter) : Bool { return false; }
	public static function filteri       (filter : Filter, param : Int, iValue    : Int)      : Void { }
	public static function filteriv      (filter : Filter, param : Int, piValues  : hl.Bytes) : Void { }
	public static function filterf       (filter : Filter, param : Int, flValue   : hl.F32)   : Void { }
	public static function filterfv      (filter : Filter, param : Int, pflValues : hl.Bytes) : Void { }
	public static function getFilteri    (filter : Filter, param : Int)                       : Int { return 0; }
	public static function getFilteriv   (filter : Filter, param : Int, piValues  : hl.Bytes) : Void { }
	public static function getFilterf    (filter : Filter, param : Int)                       : hl.F32 { return 0; }
	public static function getFilterfv   (filter : Filter, param : Int, pflValues : hl.Bytes) : Void { }

	public static function genAuxiliaryEffectSlots    (n : Int, effectslots : hl.Bytes) : Void { }
	public static function deleteAuxiliaryEffectSlots (n : Int, effectslots : hl.Bytes) : Void { }
	public static function isAuxiliaryEffectSlot      (effectslot : EffectSlot) : Bool { return false; }
	public static function auxiliaryEffectSloti       (effectslot : EffectSlot, param : Int, iValue    : Int)      : Void { }
	public static function auxiliaryEffectSlotiv      (effectslot : EffectSlot, param : Int, piValues  : hl.Bytes) : Void { }
	public static function auxiliaryEffectSlotf       (effectslot : EffectSlot, param : Int, flValue   : hl.F32)   : Void { }
	public static function auxiliaryEffectSlotfv      (effectslot : EffectSlot, param : Int, pflValues : hl.Bytes) : Void { }
	public static function getAuxiliaryEffectSloti    (effectslot : EffectSlot, param : Int) : Int { return 0; }
	public static function getAuxiliaryEffectSlotiv   (effectslot : EffectSlot, param : Int, piValues  : hl.Bytes)  : Void { }
	public static function getAuxiliaryEffectSlotf    (effectslot : EffectSlot, param : Int) : hl.F32 { return 0; }
	public static function getAuxiliaryEffectSlotfv   (effectslot : EffectSlot, param : Int, pflValues : hl.Bytes)  : Void { }
}

@thejustinwalsh
Copy link
Author

Had to add PNG_ARM_NEON_OPT=0 to preprocessor macros because arm64 didn't want to link with it enabled.

@thejustinwalsh
Copy link
Author

thejustinwalsh commented May 12, 2018

I have about 9k duplicate symbols all coming from heaps now. So, everything is compiling and almost linking. Things like... _h2d_col_Matrix_prependTranslate defined in both MyApp-59865.o and Matrix-48723.0.

EDIT: Do not add anything other than the top level generated source from hl, i.e. MyApp.c to your project as it includes all the other c files it needs to compile.

@thejustinwalsh
Copy link
Author

@ncannasse Do you have a recommendation for a way to make EFX a configuration option, or long term would you prefer openal-soft compiled per platform as a dynamic library to stay in check with the lgpl?

@starburst997
Copy link
Contributor

starburst997 commented May 12, 2018

Hey thanks @thejustinwalsh ! Got heaps (hlc) to run on both mac and iOS thanks to your tips (well I have a nice spinning red rectangle, will test the samples later and I do expect some roadblock haha).

Wasn't as hard as I expect, altho having some "official" XCode template would be super nice. Here's mine if anyone interested, might add a quick README eventually (the xcode project expect the hashlink folder to be at the same level as the git folder, see the build-c.hxml if it isn't clear) added submodules and the xcode project point to them.

https://github.com/starburst997/xcode-heaps

Also some minor fixes in hashlink for ios: https://github.com/starburst997/hashlink/tree/ios-fixes

Mind sharing yours? I'm curious

@thejustinwalsh
Copy link
Author

@starburst997 Awesome! I am working on a template that i'm about ready to share. Still working out some kinks. I'll post a link here. I'm also working on a few PRs for mobile support for the main hashlink and heaps repos.

@starburst997
Copy link
Contributor

Alright, got all samples running and working, the 3D ones, like "world" have a few visual glitches, I was pleasantly surprised that I had to do nothing for the assets to somehow end up in the app (really need to check how this black magic is performed).

@thejustinwalsh
Copy link
Author

thejustinwalsh commented May 15, 2018

@starburst997 Here are the only modifications I had to make to get hashlink compiling on iOS

Stubbing EFX.hx and wrapping a few gl calls with !defined(HL_MOBILE) in gl.c

Here is a script that I am using on appcenter.ms to fully install and compile everything from scratch on a fresh environment. It's not the prettiest but it compiles, links, and runs, with minimal modification.

In order to build, It required me syncing to very specific revisions of development repositories, so obviously as versions stabilize this will not be needed.

I am planning on submitting my modifications as a PR when I get some time this weekend, however the hack needed to EFX.hx probably wont fly, so finding a solution that allows a developer to turn it off / on for specific platforms / targets would be ideal.

I use the same script for boot-strapping my project where I have the dependencies installed already as well. Additionally, I added a Run Script phase to my Xcode Project that generates the source and creates the res.pak file before compiling and bundling. That script is the tail end of my boot-strap script above.

As soon as a fix for OpenAL/EFX and OpenGL/GLES go in, I believe this issue should be marked as closed / archived. Additionally we should probably create a new issue for the OpenAL/EFX thing to reduce the noise.

@starburst997
Copy link
Contributor

starburst997 commented May 15, 2018

Nice! Looks very similar to the edit I had to do, did you try to build like the "World" samples from heaps? Did you have any visual glitch? Here's what it look like on my iphone 7

heaps_test

No issue on 2D as far as I can see yet.

@thejustinwalsh
Copy link
Author

I'll try the World sample soon and let you know.

@tanis2000
Copy link
Contributor

I see that there's a fork from the guys at Playdigious here https://github.com/playdigious/hashlink
It looks like most of the changes haven't been merged back into this repo. Is there any plan in building a toolset to actually create the iOS project with all the dependencies (eventually already compiled as hdll from a CI server) starting from an Heaps project?

@ncannasse
Copy link
Member

@tanis2000 I think we have merged the most important things, I'm sure @rtissera can tell more about it.

@tanis2000
Copy link
Contributor

That’s good. I’ve been thinking about something like https://github.com/native-toolkit but for projects using HL. Maybe we can build repos for all of the libraries involved so that they can be easily compiled for the different platforms and included as static/dynamic libraries as needed.
But then we would need a tool to coordinate all that and eventually run the various builds on CI servers so that precompiled libraries can be bundled. Just thinking out loud.

@jeremyfa
Copy link

Following this topic silently, out of curiosity I tried to build libjpeg-turbo from source for iOS and iOS Simulator with bitcode enabled.

Although I didn't tested the resulting binary in a project, I successfuly built (from mac) a universal binary (armv7, arm64, i386, x86_64). You can find the build script I setup and used (and the binary) there. Hopefully this binary will work for HEAPS/Xcode projects and solve the bitcode problem?

@kkukshtel
Copy link

Any movement on this? Looking at Heaps for an iOS project and unclear what state it's in.

@felixakiragreen
Copy link

I have a game that is nearly complete, still working on trying to get the iOS build to work correctly so I can publish to App Store.

@kkukshtel
Copy link

@xenophilicibex Have you gotten iOS running properly then? If so, would love to see if you have code anywhere or have written a guide about how to do it!

@felixakiragreen
Copy link

felixakiragreen commented Mar 27, 2019

@kkukshtel I was able to get this project: https://github.com/starburst997/xcode-heaps up & running. But was not successful in getting my game running, I just get a black screen, though logging is working. I hope to get some time in the next few weeks to really dig in and figure out the iOS build so I can publish it.

Edit: I think the only thing really holding Heaps back is the ease of publishing. I got stuck in May 2018, and gave up for the time being, hoping there would be a community solution by the time I came back.

@starburst997
Copy link
Contributor

I could update that sample, I do have a running version of heaps on iOS but haven't updated that repo in a while, don't have much time this week but maybe I could get something this we

@kkukshtel
Copy link

kkukshtel commented Mar 27, 2019 via email

@thejustinwalsh
Copy link
Author

thejustinwalsh commented Mar 30, 2019

Got my old sample project compiling once again with haxe 4.0.0-rc2, heaps 1.6.1, and hashlink 1.9.0 for iOS. Still had to create an efx shim to get it to compile when using OpenAL.framework for iOS included with the iOS SDK.

No other hacks needed this time though, and shimming the EFX calls in a simple c file is way easier than patching hashlink.

Updated build script to match as well... The last piece of the puzzle is just the Xcode project itself. Working on stripping down my Xcode project and uploading a shell project, however I already spent must of my weekend free time simply updating my own project.

@thejustinwalsh
Copy link
Author

New template project for iOS is up!
https://github.com/thejustinwalsh/heaps-ios

@starburst997 Same issues as you when using h3d or more specifically the World sample. Looks like triangles are choosing not to render, some kind of z-fighting / depth issue...

Not sure when or how diligent I will be in updating the sample when version change happens, however any PR is welcome. Currently working with haxe 4.0.0-rc.2+77068e1, hl 1.9.0, heaps 1.6.1, hxbit 1.4.1, format 3.4.2, hlsdl 1.9.0.

@kkukshtel
Copy link

kkukshtel commented Apr 15, 2019 via email

@thejustinwalsh
Copy link
Author

thejustinwalsh commented Apr 15, 2019

I'll have to update the readme now that you mention it...

  • I've disable OpenAL EFX extensions
  • You will need to modify the build and pak scripts to suit your combination of assets and libraries you are using.
  • No High DPI support so your artwork will be scaled on the screen and your viewport will be in the format of 1 point = 1 pixel instead of 1 point = 4 pixels. Issue #589.

@thejustinwalsh
Copy link
Author

So just tried the heaps samples on my iPhone in the web browser. Same visual artifacts are happening there as well with the skinning and world samples. That bug seems to be heaps related or specific to some apple OpenGL to metal translation? Regardless I will create a new issue in heaps specifically with screen captures.

@ncannasse
Copy link
Member

@thejustinwalsh check if it works better with HeapsIO/heaps#599

@thejustinwalsh
Copy link
Author

@ncannasse I have merged in the above PR (HeapsIO/heaps#599) and am not seeing any better results. Suggesting we move further discussion of particular issue to HeapsIO/heaps#602.

@qkdreyer
Copy link
Contributor

qkdreyer commented Feb 8, 2020

I've finally managed to compile a heaps project using https://github.com/thejustinwalsh/heaps-ios as a base project.

  • haxe 4.0.5
  • hashlink 1.10
  • heaps 1.7.0
  • haxelib 4.0.2
    • format 3.5.0
    • hashlink 0.1.0
    • hlopenal 1.5.0
    • hlsdl 1.10.0
  • libpng 1.6.37
  • jpeg-turbo 2.0.4
  • libvorbis 1.3.6
  • sdl2: 2.0.10
  • mbedtls 2.16.4
  • openal-soft 1.20.1
  • libuv 1.34.2

These are the modifications I had to apply to fully make it work :

  • Patching Hashlink SDL2 Header Path : cd build/ios/deps/hashlink && curl https://gist.githubusercontent.com/qkdreyer/1a22b10fe4064554f724bf5a400fe470/raw/8524ef768e79c1668eb5cea8fbf7216ca816f5b9/gistfile1.txt | git apply as stated here : https://github.com/HaxeFoundation/hashlink/blob/master/other/cmake/FindSDL2.cmake#L49 (@ncannasse) - https://github.com/thejustinwalsh/heaps-ios/blob/master/build/appcenter-post-clone.sh#L40 felt silly

  • Patching SDL Xcode Project DEVELOPMENT_TEAM : cd build/ios/deps/SDL && curl https://gist.githubusercontent.com/qkdreyer/0d906ddf6c16ced2e949646f0e4e7287/raw/cfb0e6cbdaf698af258eac21a86c75840c0268c2/gistfile1.txt | git apply

  • Patching Linker Heaps _fmt_dxt_decode Missing Symbol : cd build/ios/deps/heaps && curl https://gist.githubusercontent.com/qkdreyer/54245f242ce69d61bd4816e135dcb930/raw/e6392463adfa438110d06a0d65c289009c73400a/gistfile1.txt | git apply (@ncannasse)

  • Patching Invalid dnLibs Variable Names : cd build/ios/deps/deepnightLibs && curl https://gist.githubusercontent.com/qkdreyer/4dbcc91065f1336e2cd6efa2b380fea9/raw/fb5103cace23626609a767fc7fe2c0893d6249e2/gistfile1.txt | git apply
    For some reasons, when compiling to C, gcc would include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h and conflicts on these variable names (@deepnight)

You will also need to update the App.xcodeproj DEVELOPMENT_TEAM and PRODUCT_BUNDLE_IDENTIFIER in the Signing & Capabilities target tab.

You will also need to define sdl__Sdl__val in the GCC_PREPROCESSOR_DEFINITIONS because of this : https://github.com/HaxeFoundation/hashlink/pull/101/files#diff-2e6cb46956f711087d1dde23e196527fR24

@ncannasse
Copy link
Member

  • SDL2 patch is merged
  • I'm getting 404 errors for gists so can't comment on fixes they apply
  • I commented on sdl__Sdl__val

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants