Lime is a flexible, lightweight layer for Haxe cross-platform developers.
Lime supports native, Flash and HTML5 targets with unified support for:
- Windowing
- Input
- Events
- Audio
- Render contexts
- Network access
- Assets
Lime does not include a renderer, but exposes the current context:
- Cairo
- Canvas
- DOM
- Flash
- GL
- Vulkan
The GL context is based upon the WebGL standard, implemented for both OpenGL and OpenGL ES as needed.
Where a desktop has no usable GPU OpenGL, native windows fall back to Cairo. With the software-gl define, Windows, macOS and Linux try OpenGL drawn in software first: Mesa's llvmpipe on Windows and Linux, and Apple's software renderer on macOS. Windows builds copy Mesa from the lime-mesa haxelib into a mesa folder beside the executable, for 64-bit builds without angle. Linux needs Mesa installed. On Apple silicon, Apple's software renderer draws some lines and textures wrongly (actions/runner-images#9712). A context drawn in software reports window.context.attributes.hardware as false. To test a software-gl build as a machine without a GPU would run it, set the LIME_SOFTWARE_GL=1 environment variable.
Native Vulkan support exposes an explicit Vulkan API layer for renderer backends, including native window/swapchain integration and resource/command primitives.
Native Vulkan support is included in standard Windows, Linux and Android Lime builds. Windows and Linux C++ builds also define the matching Haxe API, and on Android the vulkan define turns it on. Apple targets still require an explicit Vulkan-enabled build and MoltenVK packaging.
To request a Vulkan window, use the standard RenderContextType.VULKAN context selection, or build with -Dvulkan (or <define name="vulkan" /> before <haxelib name="lime" /> in project XML) to make Vulkan the default for windows that name no type.
The in-repo tests/vulkan-smoke project is used as the current Vulkan CI smoke app.
Lime provides a unified audio API, but also provides access to OpenAL for advanced audio on native targets.
Lime is free, open-source software under the MIT license.
First, install the latest version of Haxe.
Then, install Lime from Haxelib and run Lime's setup command.
haxelib install lime
haxelib run lime setup
When there are changes, Lime is built nightly. Builds are available for download here.
To install a development build, use the "haxelib local" command:
haxelib local lime-haxelib.zip
-
Clone the Lime repository, as well as the submodules:
haxelib git lime https://github.com/openfl/lime -
Install required dependencies:
haxelib install format haxelib install hxp haxelib install native-desktop 1.1.0 haxelib install native-ipc 1.0.0 haxelib install StageWebView 1.0.1 haxelib install wsproto 1.0.0 haxelib install crossbyte 1.0.1 -
Copy the ndll directory from the latest Haxelib release, or see project/README.md for details about building native binaries.
-
After any changes to the tools or lime/tools directories, rebuild from source:
lime rebuild toolsThis needs Haxe 4.3 or later, for CrossByte, which serves
lime test html5. Applications still build with older Haxe versions. -
To switch away from a source build:
haxelib set lime [version number]
You can build a sample Lime project with the following commands:
lime create HelloWorld
cd HelloWorld
lime test neko
You can also list other projects that are available using "lime create".
Lime currently supports the following targets:
lime test windows
lime test mac
lime test linux
lime test android
lime test ios
lime test html5
lime test flash
lime test air
lime test neko
lime test hl
Desktop builds are currently designed to be built on the same host OS
Have a question? Want a new place to hang out?