Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
28f509d
Update GLImageFormats.java
joliver82 May 17, 2018
71fcaa9
Merge remote-tracking branch 'upstream/master'
joliver82 May 23, 2018
4f8a2cc
Merge pull request #3 from jMonkeyEngine/master
joliver82 Nov 14, 2018
05db003
Merge pull request #4 from jMonkeyEngine/master
joliver82 Jun 1, 2019
18b431f
Modified JmeBatchRenderBackend to clear the inner buffer of the image…
Nov 19, 2019
38e330b
Merge pull request #5 from jMonkeyEngine/master
joliver82 Nov 20, 2019
f9282c1
First impl of testcasefor multiple atlases issue. Still missing to ad…
joliver82 Dec 19, 2019
9d8cbfa
Merge pull request #7 from jMonkeyEngine/master
joliver82 Mar 9, 2020
2a6ca82
Merge branch 'nifty-batch-fix' into master
joliver82 Mar 9, 2020
0569a0a
Merge remote-tracking branch 'upstream/master'
Jan 25, 2021
8a90e91
Manual merge pending stuff from jme3 base
Jan 25, 2021
1092b80
Manual merge
Jan 25, 2021
066ba48
Merge pull request #9 from jMonkeyEngine/master
joliver82 Feb 15, 2021
6a4b4d2
Merge pull request #10 from jMonkeyEngine/master
joliver82 Mar 16, 2021
2800a92
Merge branch 'jMonkeyEngine:master' into master
joliver82 Oct 7, 2024
62f5398
Merge branch 'jMonkeyEngine:master' into master
joliver82 Apr 25, 2025
0248d8e
Merge branch 'jMonkeyEngine:master' into master
joliver82 Jul 9, 2025
d95b31a
Updated openalsoft based on NGEngine and set ANDROID_SUPPORT_FLEXIBLE…
Aug 30, 2025
605866a
Changed docker image to build android natives to ghcr.io/cirruslabs/a…
Sep 7, 2025
be712c7
Changed github actions to install cmake in docker image and properly …
Sep 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,35 @@ jobs:
name: Build natives for android
runs-on: ubuntu-latest
container:
image: jmonkeyengine/buildenv-jme3:android
image: ghcr.io/cirruslabs/android-sdk:35-ndk

steps:
- name: Clone the repo
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'

- name: Check java version
run: java -version

- name: Install CMake
run: |
apt-get update
apt-get install -y cmake
cmake --version

- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Build
run: |
export ANDROID_NDK="$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION"
./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
:jme3-android-native:assemble

Expand Down
102 changes: 96 additions & 6 deletions jme3-android-native/openalsoft.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// OpenAL Soft r1.21.1
// TODO: update URL to jMonkeyEngine fork once it's updated with latest kcat's changes
String openALSoftUrl = 'https://github.com/kcat/openal-soft/archive/1.21.1.zip'
String openALSoftUrl = 'https://github.com/kcat/openal-soft/archive/1.24.3.zip'
String openALSoftZipFile = 'OpenALSoft.zip'

// OpenAL Soft directory the download is extracted into
// Typically, the downloaded OpenAL Soft zip file will extract to a directory
// called "openal-soft"
String openALSoftFolder = 'openal-soft-1.21.1'
String openALSoftFolder = 'openal-soft-1.24.3'

//Working directories for the ndk build.
String openalsoftBuildDir = "${buildDir}" + File.separator + 'openalsoft'
Expand Down Expand Up @@ -81,13 +81,102 @@ task copyJmeOpenALSoft(type: Copy, dependsOn: [copyOpenALSoft, copyJmeHeadersOpe
from sourceDir
into outputDir
}
// rootProject.ndkCommandPath must be set to your ndk-build wrapper or full ndk path
def ndkPath = new File(rootProject.ndkCommandPath).getParent()
def cmakeToolchain = "${ndkPath}/build/cmake/android.toolchain.cmake"

// 1) list your ABIs here
def openalAbis = [
"armeabi-v7a",
"arm64-v8a",
"x86",
"x86_64"
]

// 2) for each ABI, register a configure/build pair
openalAbis.each { abi ->

// configure task
tasks.register("configureOpenAlSoft_${abi}", Exec) {
group = "external-native"
description = "Generate CMake build files for OpenAL-Soft [$abi]"

workingDir file("$openalsoftBuildDir/$openALSoftFolder")
commandLine = [
"cmake",
"-S", ".",
"-B", "cmake-build-${abi}",
"-G", "Unix Makefiles", // or Ninja
"-DCMAKE_TOOLCHAIN_FILE=${cmakeToolchain}",
"-DANDROID_PLATFORM=android-21",
"-DANDROID_ABI=${abi}",
"-DCMAKE_BUILD_TYPE=Release",
"-DALSOFT_UTILS=OFF",
"-DALSOFT_EXAMPLES=OFF",
"-DALSOFT_TESTS=OFF",
"-DALSOFT_BACKEND_OPENSL=ON",
'-DALSOFT_SHARED=OFF',
'-DBUILD_SHARED_LIBS=OFF',
'-DALSOFT_STATIC=ON',
'-DLIBTYPE=STATIC'
]

dependsOn copyOpenALSoft
}

// build task
tasks.register("buildOpenAlSoft_${abi}", Exec) {
group = "external-native"
description = "Compile OpenAL-Soft into libopenalsoft.a for [$abi]"

dependsOn "configureOpenAlSoft_${abi}"
workingDir file("$openalsoftBuildDir/$openALSoftFolder")
commandLine = [
"cmake",
"--build", "cmake-build-${abi}",
"--config", "Release"
]
}
}

// 3) optional: aggregate tasks
tasks.register("configureOpenAlSoftAll") {
group = "external-native"
description = "Configure OpenAL-Soft for all ABIs"
dependsOn openalAbis.collect { "configureOpenAlSoft_${it}" }
}

tasks.register("buildOpenAlSoftAll") {
group = "external-native"
description = "Build OpenAL-Soft for all ABIs"
dependsOn openalAbis.collect { "buildOpenAlSoft_${it}" }
}

task buildOpenAlSoftNativeLib(type: Exec, dependsOn: copyJmeOpenALSoft) {
// println "openalsoft build dir: " + openalsoftBuildDir
// println "ndkCommandPath: " + project.ndkCommandPath
task buildOpenAlSoftNativeLib(type: Exec) {
group = "external-native"
description = "Runs ndk-build on your JNI code, linking in the prebuilt OpenAL-Soft .a files"

dependsOn copyJmeOpenALSoft, buildOpenAlSoftAll

// where your Android.mk lives
workingDir openalsoftBuildDir

// call the NDK build script
executable rootProject.ndkCommandPath
args "-j" + Runtime.runtime.availableProcessors()

// pass in all ABIs (so ndk-build will rebuild your shared .so for each one),
// and pass in a custom var OPENALSOFT_BUILD_DIR so your Android.mk can find
// the cmake-build-<ABI> folders.
args(
// let ndk-build know which ABIs to build for
"APP_ABI=armeabi-v7a,arm64-v8a,x86,x86_64",

// pass in the path to the CMake output root
"OPENALSOFT_BUILD_ROOT=${openalsoftBuildDir}/${openALSoftFolder}",

// parallel jobs
"-j${Runtime.runtime.availableProcessors()}"
)
}

task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) {
Expand Down Expand Up @@ -140,3 +229,4 @@ class MyDownload extends DefaultTask {
ant.get(src: sourceUrl, dest: target)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_CFLAGS := -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true
LOCAL_LDLIBS := -llog -Wl,-s

LOCAL_MODULE := bufferallocatorjme
Expand Down
2 changes: 1 addition & 1 deletion jme3-android-native/src/native/jme_decode/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LOCAL_C_INCLUDES:= \
$(LOCAL_PATH) \
$(LOCAL_PATH)/Tremor

LOCAL_CFLAGS := -std=gnu99 -DLIMIT_TO_64kHz -O0
LOCAL_CFLAGS := -std=gnu99 -DLIMIT_TO_64kHz -O0 -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true
LOCAL_LDLIBS := -lz -llog -Wl,-s

ifeq ($(TARGET_ARCH),arm)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>

#include "Tremor/ivorbisfile.h"

Expand Down
134 changes: 40 additions & 94 deletions jme3-android-native/src/native/jme_openalsoft/Android.mk
Original file line number Diff line number Diff line change
@@ -1,103 +1,49 @@
TARGET_PLATFORM := android-19
# jni/Android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := openalsoftjme

LOCAL_C_INCLUDES += $(LOCAL_PATH) $(LOCAL_PATH)/include \
$(LOCAL_PATH)/alc $(LOCAL_PATH)/common
# require the path to cmake-build-<ABI>
ifndef OPENALSOFT_BUILD_ROOT
$(error OPENALSOFT_BUILD_ROOT not set! pass it via ndk-build OPENALSOFT_BUILD_ROOT=/path/to/cmake-build-root)
endif

LOCAL_CPP_FEATURES += exceptions
# assemble the path to this ABI's .a
OPENAL_PREBUILT_DIR := $(OPENALSOFT_BUILD_ROOT)/cmake-build-$(TARGET_ARCH_ABI)

LOCAL_CFLAGS := -ffast-math -DAL_BUILD_LIBRARY -DAL_ALEXT_PROTOTYPES -fcommon -O0 -DRESTRICT=""
LOCAL_LDLIBS := -lOpenSLES -llog -Wl,-s
# -----------------------------------------------------------------------------
# 1) prebuilt static library
include $(CLEAR_VARS)
LOCAL_MODULE := openalsoft_prebuilt
LOCAL_SRC_FILES := $(OPENAL_PREBUILT_DIR)/libopenal.a
LOCAL_EXPORT_C_INCLUDES := $(OPENALSOFT_BUILD_ROOT)/include
include $(PREBUILT_STATIC_LIBRARY)

LOCAL_SRC_FILES := al/auxeffectslot.cpp \
al/buffer.cpp \
al/effect.cpp \
al/effects/autowah.cpp \
al/effects/chorus.cpp \
al/effects/compressor.cpp \
al/effects/convolution.cpp \
al/effects/dedicated.cpp \
al/effects/distortion.cpp \
al/effects/echo.cpp \
al/effects/equalizer.cpp \
al/effects/fshifter.cpp \
al/effects/modulator.cpp \
al/effects/null.cpp \
al/effects/pshifter.cpp \
al/effects/reverb.cpp \
al/effects/vmorpher.cpp \
al/error.cpp \
al/event.cpp \
al/extension.cpp \
al/filter.cpp \
al/listener.cpp \
al/source.cpp \
al/state.cpp \
alc/alc.cpp \
alc/alconfig.cpp \
alc/alu.cpp \
alc/backends/base.cpp \
alc/backends/loopback.cpp \
alc/backends/null.cpp \
alc/backends/opensl.cpp \
alc/backends/wave.cpp \
alc/bformatdec.cpp \
alc/buffer_storage.cpp \
alc/converter.cpp \
alc/effects/autowah.cpp \
alc/effects/chorus.cpp \
alc/effects/compressor.cpp \
alc/effects/convolution.cpp \
alc/effects/dedicated.cpp \
alc/effects/distortion.cpp \
alc/effects/echo.cpp \
alc/effects/equalizer.cpp \
alc/effects/fshifter.cpp \
alc/effects/modulator.cpp \
alc/effects/null.cpp \
alc/effects/pshifter.cpp \
alc/effects/reverb.cpp \
alc/effects/vmorpher.cpp \
alc/effectslot.cpp \
alc/helpers.cpp \
alc/hrtf.cpp \
alc/panning.cpp \
alc/uiddefs.cpp \
alc/voice.cpp \
common/alcomplex.cpp \
common/alfstream.cpp \
common/almalloc.cpp \
common/alstring.cpp \
common/dynload.cpp \
common/polyphase_resampler.cpp \
common/ringbuffer.cpp \
common/strutils.cpp \
common/threads.cpp \
core/ambdec.cpp \
core/bs2b.cpp \
core/bsinc_tables.cpp \
core/cpu_caps.cpp \
core/devformat.cpp \
core/except.cpp \
core/filters/biquad.cpp \
core/filters/nfc.cpp \
core/filters/splitter.cpp \
core/fmt_traits.cpp \
core/fpu_ctrl.cpp \
core/logging.cpp \
core/mastering.cpp \
core/mixer/mixer_c.cpp \
core/uhjfilter.cpp \
com_jme3_audio_android_AndroidAL.c \
com_jme3_audio_android_AndroidALC.c \
com_jme3_audio_android_AndroidEFX.c
# -----------------------------------------------------------------------------
# 2) your JNI wrapper
include $(CLEAR_VARS)
LOCAL_MODULE := openalsoftjme
LOCAL_SRC_FILES := \
com_jme3_audio_android_AndroidAL.c \
com_jme3_audio_android_AndroidALC.c \
com_jme3_audio_android_AndroidEFX.c

LOCAL_C_INCLUDES += \
$(LOCAL_PATH) \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/alc \
$(LOCAL_PATH)/common

LOCAL_CPP_FEATURES := exceptions rtti
LOCAL_CFLAGS := -ffast-math \
-DAL_ALEXT_PROTOTYPES \
-fcommon \
-O0 \
-DRESTRICT="" \
-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true

LOCAL_LDLIBS := -lOpenSLES -llog -Wl,-s -lc++_shared
LOCAL_STATIC_LIBRARIES := openalsoft_prebuilt
# (or LOCAL_WHOLE_STATIC_LIBRARIES if you need every object pulled in)

include $(BUILD_SHARED_LIBRARY)

# Alc/mixer/hrtf_inc.c \

Loading