Skip to content

WIP. Libgdx Html5 solution in a single repository.

License

Notifications You must be signed in to change notification settings

noblemaster/gdx-teavm

 
 

Repository files navigation

gdx-teavm

Build Build Sonatype Nexus (Snapshots) Static Badge

gdx-teavm is a backend solution for running libgdx games in a web browser. It uses TeaVM behind the scene to convert Java/Kotlin bytecode to Javascript.

Note:

  • Reflection support is very small so only reflection used in tests will work.
  • TeaVM does not support every class methods from java package or JNI native methods. Check teaVM java classes here.
  • Kotlin discussions.
  • Box2d, Bullet, ImGui, PhysX and Freetype libraries use emscripten and jParser to convert C++ to Javascript/WebAssembly.

TeaVM Examples:

TeaVM Games:

Setup:

// Add sonatype repository to Root gradle
repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    maven { url "https://teavm.org/maven/repository/" }
    
    // If there is a problem with the teavm repository, you can try using http
    maven {
        url = uri("http://teavm.org/maven/repository/")
        isAllowInsecureProtocol = true
    }
}
// SNAPSHOT:
gdxTeaVMVersion = "-SNAPSHOT"
// RELEASE:
gdxTeaVMVersion = "[LAST_TAG_VERSION]"
// In teaVM module
dependencies {
    implementation "com.github.xpenatan.gdx-teavm:backend-teavm:$project.gdxTeaVMVersion"

    // FreeType extension
    implementation "com.github.xpenatan.gdx-teavm:gdx-freetype-teavm:$project.gdxTeaVMVersion"
}

Supported libraries:

About

WIP. Libgdx Html5 solution in a single repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 74.6%
  • C 24.4%
  • CMake 0.3%
  • C++ 0.2%
  • Kotlin 0.2%
  • HTML 0.2%
  • Other 0.1%