Skip to content
openflPublic

About

A foundational Haxe framework for cross-platform development

Topics

Resources

Contributing

Stars

863 stars

Watchers

43 watching

Forks

Latest commit

 

History

7,722 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License Haxelib Version Build Status Community Discord Server

Lime

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.

GL

The GL context follows the WebGL standard, running on OpenGL or OpenGL ES as each platform needs.

  • ANGLE (Windows and macOS): the angle define draws through ANGLE on Direct3D 11 or Metal instead of the GPU's own OpenGL, with an OpenGL ES 3.0 context. Install the lime-angle haxelib, which covers 32-bit and 64-bit Windows and Apple silicon and Intel Macs, then rebuild Lime with the define: lime rebuild windows -Dangle or lime rebuild mac -Dangle. macOS needs version 13 or later.
  • Without GPU OpenGL: native desktop windows fall back to Cairo. With the software-gl define, 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 angle copy Mesa from the lime-mesa haxelib into a mesa folder 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.hardware as false. To run a software-gl build as a machine without a GPU would, set LIME_SOFTWARE_GL=1.

Linux compositing

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.

Vulkan

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 vulkan define 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 vulkan define takes from the lime-moltenvk haxelib. macOS applications carry it in their bundle's Contents/Frameworks folder, 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_subset extension.
    • To use another Vulkan library on macOS, such as the Vulkan SDK's loader with its validation layers, set SDL_VULKAN_LIBRARY to its path.
  • CI: tests/vulkan-smoke is the Vulkan smoke test app.

License

Lime is free, open-source software under the MIT license.

Installation

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

Development Builds

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

Building from Source

  1. Clone the Lime repository, as well as the submodules:

     haxelib git lime https://github.com/openfl/lime
    
  2. 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
    
  3. Copy the ndll directory from the latest Haxelib release, or see project/README.md for details about building native binaries.

  4. After any changes to the tools or lime/tools directories, rebuild from source:

     lime rebuild tools
    

    This needs Haxe 4.3 or later, for CrossByte, which serves lime test html5. Applications still build with older Haxe versions.

  5. To switch away from a source build:

     haxelib set lime [version number]
    

Sample

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".

Targets

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

Join the Community

Have a question? Want a new place to hang out?

About

A foundational Haxe framework for cross-platform development

Topics

Resources

Contributing

Stars

863 stars

Watchers

43 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages