MIT License Haxelib Version Build Status Community Discord Server
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
Lime provides a unified audio API, but also provides access to OpenAL for advanced audio on native targets.
The GL context follows the WebGL standard, running on OpenGL or OpenGL ES as each platform needs.
- ANGLE (Windows and macOS): the
angledefine draws through ANGLE on Direct3D 11 or Metal instead of the GPU's own OpenGL, with an OpenGL ES 3.0 context. Install thelime-anglehaxelib, which covers 32-bit and 64-bit Windows and Apple silicon and Intel Macs, then rebuild Lime with the define:lime rebuild windows -Dangleorlime rebuild mac -Dangle. macOS needs version 13 or later. - Without GPU OpenGL: native desktop windows fall back to Cairo. With the
software-gldefine, Windows, macOS and Linux first try OpenGL drawn in software: Mesa's llvmpipe on Windows and Linux, Apple's software renderer on macOS.- Windows: 64-bit builds without
anglecopy Mesa from thelime-mesahaxelib into amesafolder beside the executable. - Linux: Mesa must be installed.
- Apple silicon: Apple's software renderer draws some lines and textures wrongly (actions/runner-images#9712).
- A software context reports
window.context.attributes.hardwareasfalse. To run asoftware-glbuild as a machine without a GPU would, setLIME_SOFTWARE_GL=1.
- Windows: 64-bit builds without
On X11, SDL asks the compositor to bypass each window, which saves a full-screen game the compositor's work. KWin does this by suspending compositing for the whole desktop while the window is open.
To keep the compositor running, as transparent windows always do, build with the lime-keep-compositor define (-Dlime-keep-compositor, or <define name="lime-keep-compositor" /> in project XML). For a build without the define, set SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR=0.
Native Vulkan support is experimental, and its API can change in a minor release. It gives renderer backends an explicit Vulkan API, with native window and swapchain integration and resource and command primitives.
- Platforms: standard Windows, Linux, Android, macOS and iOS builds include it. Windows and Linux C++ builds turn on the Haxe API by default; on Android, macOS and iOS, the
vulkandefine turns it on. tvOS has no Vulkan support yet. - Requesting a Vulkan window: use
RenderContextType.VULKAN, or build with-Dvulkan(or<define name="vulkan" />before<haxelib name="lime" />in project XML) to make Vulkan the default for windows that don't name a type. - macOS and iOS: Vulkan runs on Metal through MoltenVK, which the
vulkandefine takes from thelime-moltenvkhaxelib. macOS applications carry it in their bundle'sContents/Frameworksfolder, and iOS applications embed its framework.- MoltenVK implements most of Vulkan but not all of it. Its devices list what they leave out through the
VK_KHR_portability_subsetextension. - To use another Vulkan library on macOS, such as the Vulkan SDK's loader with its validation layers, set
SDL_VULKAN_LIBRARYto its path.
- MoltenVK implements most of Vulkan but not all of it. Its devices list what they leave out through the
- CI:
tests/vulkan-smokeis the Vulkan smoke test app.
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.2.2 haxelib install native-ipc 1.0.0 haxelib install StageWebView 1.1.2 haxelib install wsproto 1.1.2 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?