Skip to content

Commit

Permalink
Switch from GLFW to SDL / Remove OpenVR support / Update LWJGL to lat…
Browse files Browse the repository at this point in the history
…est SNAPSHOT
  • Loading branch information
bwRavencl committed Feb 13, 2025
1 parent 362c638 commit 3841748
Show file tree
Hide file tree
Showing 66 changed files with 1,760 additions and 4,482 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ If you are running Linux, you additionally have the option of using the [Control
- Displays current mode
- Can show current position of virtual axes
- On-Screen-Keyboard that can be controlled by gamepad
- VR support (OpenVR on Windows)
- Customizable position and colors
- Two modes of operation:
- Local
Expand Down Expand Up @@ -195,8 +194,6 @@ Server-Client mode:
![Overlay](screenshot_7.png)
![VR Overlay](screenshot_8.png)
## Command Line Parameters
| Parameter | Arguments | Description | Available for scripting |
Expand Down Expand Up @@ -233,9 +230,7 @@ ControllerBuddy makes use of these awesome software technologies and libraries:
- [Error Prone](https://errorprone.info/)
- [FlatLaf](https://www.formdev.com/flatlaf/)
- [Gson](https://github.com/google/gson)
- [hid4java](https://github.com/gary-rowe/hid4java)
- [Java Native Access (JNA)](https://github.com/java-native-access/jna)
- [JXInput](https://github.com/StrikerX3/JXInput)
- [linuxio4j](https://github.com/bithatch/linuxio4j)
- [LWJGL - Lightweight Java Game Library 3](https://www.lwjgl.org)
- [SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB)
Expand Down
43 changes: 13 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ ext {
runtimeDir = tmpDir.map { it.dir 'runtime' }

xmsJvmArg = '-Xms128m'

linuxJvmArgs = [
"--add-opens=java.desktop/sun.awt=${project.application.mainModule.get()}",
"--add-opens=java.desktop/sun.awt.X11=${project.application.mainModule.get()}"
Expand All @@ -59,8 +58,6 @@ ext {

arch = DefaultNativePlatform.currentArchitecture
distAppendix = "${os.toFamilyName()}-$arch.name"

openVrSupport = false
}

java {
Expand All @@ -72,6 +69,7 @@ java {

repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}

tasks.register('cleanModuleInfo') {
Expand All @@ -96,12 +94,11 @@ dependencies {

def dbusJavaVersion = '5.1.0'
def jnaVersion = '5.16.0'
def lwjglVersion = '3.3.6'
def lwjglVersion = '3.4.0-SNAPSHOT'

def lwjglOs
if (os.windows) {
lwjglOs = "windows"
openVrSupport = true
} else if (os.macOsX)
lwjglOs = 'macos'
else if (os.linux) {
Expand All @@ -119,7 +116,6 @@ dependencies {
break
case { Architectures.ARM_V7.isAlias(it) && os.linux }:
lwjglArch = 'arm32'
openVrSupport = false
break
case { Architectures.AARCH64.isAlias(it) }:
lwjglArch = 'arm64'
Expand All @@ -134,28 +130,20 @@ dependencies {
implementation 'com.formdev:flatlaf:3.5.4'
implementation("com.github.hypfvieh:dbus-java-core:$dbusJavaVersion") { exclude group: 'org.slf4j', module: 'slf4j-api' }
implementation("com.github.hypfvieh:dbus-java-transport-native-unixsocket:$dbusJavaVersion") { exclude group: 'org.slf4j', module: 'slf4j-api' }
implementation('org.hid4java:hid4java:0.8.0') { exclude module: 'jna' }
implementation 'com.xenoamess:JXInput:1.0.1'
implementation 'com.google.code.gson:gson:2.12.1'
implementation 'io.github.classgraph:classgraph:4.8.179'
implementation "net.java.dev.jna:jna-jpms:$jnaVersion"
implementation "net.java.dev.jna:jna-platform-jpms:$jnaVersion"
implementation('org.apache.xmlgraphics:batik-swing:1.18') { exclude group: 'xml-apis', module: 'xml-apis' }
implementation "org.lwjgl:lwjgl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion"
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion:natives-$lwjglPlatform"
implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-openvr:$lwjglVersion"
implementation "org.lwjgl:lwjgl:$lwjglVersion:natives-$lwjglPlatform"
implementation "org.lwjgl:lwjgl-sdl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-sdl:$lwjglVersion:natives-$lwjglPlatform"
implementation 'org.slf4j:slf4j-jdk14:2.0.16'
implementation('uk.co.bithatch:linuxio4j:2.1') {
exclude module: 'jna'
exclude module: 'jna-platform'
}
if (openVrSupport) {
implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion:natives-$lwjglPlatform"
implementation "org.lwjgl:lwjgl-openvr:$lwjglVersion:natives-$lwjglPlatform"
}
}

extraJavaModuleInfo {
Expand All @@ -166,26 +154,23 @@ extraJavaModuleInfo {
tasks.register('generateModuleInfo') {
description = "Generates the \'$moduleInfoFile\' source file"
doLast {
file(moduleInfoFile).write """\
file(moduleInfoFile).write '''\
@SuppressWarnings({"requires-automatic", "Java9RedundantRequiresStatement"})
module de.bwravencl.controllerbuddy {
exports de.bwravencl.controllerbuddy.gui;
exports de.bwravencl.controllerbuddy.dbus.freedesktop to org.freedesktop.dbus;
opens de.bwravencl.controllerbuddy.input to com.google.gson;
opens de.bwravencl.controllerbuddy.input.action to com.google.gson;
opens de.bwravencl.controllerbuddy.input.driver to com.sun.jna;
requires com.google.gson;
requires com.formdev.flatlaf;
requires com.sun.jna;
requires com.sun.jna.platform;
requires hid4java;
requires io.github.classgraph;
requires transitive java.desktop;
requires java.logging;
requires java.prefs;
requires jdk.xml.dom;
requires JXInput;
requires org.apache.commons.cli;
requires org.apache.xmlgraphics.batik.anim;
requires org.apache.xmlgraphics.batik.brdige;
Expand All @@ -196,16 +181,12 @@ tasks.register('generateModuleInfo') {
requires org.freedesktop.dbus;
requires org.lwjgl;
requires org.lwjgl.natives;
requires org.lwjgl.glfw;
requires org.lwjgl.glfw.natives;
requires org.lwjgl.opengl;
${openVrSupport ? ' requires org.lwjgl.opengl.natives;' : ''}
requires org.lwjgl.openvr;
${openVrSupport ? ' requires org.lwjgl.openvr.natives;' : ''}
requires org.lwjgl.sdl;
requires org.lwjgl.sdl.natives;
requires uk.co.bithatch.linuxio;
requires xml.apis.ext;
}
""".stripIndent()
'''.stripIndent()
}
}

Expand Down Expand Up @@ -357,10 +338,12 @@ tasks.withType(JavaCompile).configureEach {
source generateConstants.outputs.files, sourceSets.main.java
options.encoding = 'UTF-8'
gradle.taskGraph.whenReady {
if (!it.hasTask(run)) {
options.compilerArgs << '-Xlint:all' << '-Werror'
if (it.hasTask(jpackage)) {
options.compilerArgs << '-Xlint:all' << '-Xlint:-preview' << '-Werror'
options.deprecation = true
options.errorprone.error 'MissingBraces'
} else {
options.errorprone.enabled = false
}
}
}
Expand Down
Binary file removed screenshot_8.png
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3841748

Please sign in to comment.