Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cfabd80
feat: 接入 SDL3 并修复 Vulkan 帧率回调
MovTery Aug 21, 2026
e9bd6dc
fix: 修复 SDL 首帧分辨率同步
MovTery Aug 22, 2026
5697d55
fix: 完善 SDL 输入与鼠标抓取
MovTery Aug 22, 2026
869ffd4
fix: 完善 SDL 输入法输入生命周期
MovTery Aug 23, 2026
cab81b6
feat: 完善 SDL 手柄输入桥
MovTery Aug 23, 2026
b89913d
feat: 完善 SDL 手柄输入(DirectGamepad 桥 + 输入模式 + 直通修复)
MovTery Aug 23, 2026
0d0a032
fix: 修复 26.3 SDL 鼠标按钮粘滞
MovTery Aug 23, 2026
42cb476
feat: glfwGetWindowContentScale 返回真实 content scale
MovTery Aug 23, 2026
d134c5f
fix: Surface 会话状态清理
MovTery Aug 23, 2026
a265cb1
将 .java 重命名为 .kt
MovTery Aug 23, 2026
ad8dc1b
chore: 回退部分非预期更改 & 调整代码
MovTery Aug 23, 2026
593273e
fix: 正确传入渲染器插件的 EGL 库路径
MovTery Aug 23, 2026
36527d1
fix: 兼容移动端宿主 EGL 的 SDL GL 上下文创建
MovTery Aug 23, 2026
8350dbe
fix: 恢复移动端输入法(覆盖 MC 关闭屏幕键盘的 SDL hint)
MovTery Aug 24, 2026
e8461dd
fix: 使 SDL 与 LWJGL 共用同一 Vulkan 加载器(修复 Turnip 设备 VK 后端)
MovTery Aug 24, 2026
94041d0
fix: 复用主窗口绕过 Android 单窗口限制,并经 SDL_ORIENTATIONS 锁定横向
MovTery Aug 24, 2026
c17b64c
fix: VMActivity 强制 sensorLandscape(拦截 SDL 按窗口宽高的动态方向覆盖,两横向间跟随传感器且不受旋转…
MovTery Aug 24, 2026
c509c12
fix: 守卫式 JNI Attach/Detach,避免拆掉 SDL 依赖的线程 ART 附着
MovTery Aug 24, 2026
11abf51
fix: 经 SDL_LoadFunction 代理 eglSwapBuffers,恢复 SDL 路径帧率捕获
MovTery Aug 24, 2026
1e64877
feat: SDL 直通手柄输入接入控制布局的使用中感知
MovTery Aug 24, 2026
ffeb8c9
feat: 新增 “自动唤起输入法(SDL)” 设置项
MovTery Aug 24, 2026
c7a28ef
fix: 为 SDL 相关 JNI 边界类标注 @Keep
MovTery Aug 24, 2026
133a1e5
fix: 桥接 SDL 原生消息框到宿主 Activity,修复弹窗时的 JniAbort 崩溃
MovTery Aug 25, 2026
2f89d15
fix: 收紧 SDL 直通的窗口生命周期与 EGL 兼容层
MovTery Aug 25, 2026
298844b
fix: 关闭“自动唤起输入法(SDL)”后手动输入完全失效的问题
MovTery Aug 25, 2026
4b2e349
feat: 游戏内使用手柄前弹出偏好设置对话框
MovTery Aug 28, 2026
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
21 changes: 20 additions & 1 deletion LWJGL/3.3.3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import java.security.MessageDigest

plugins {
java
}

fun writeVersion(file: File, inputs: List<File>) {
val digest = MessageDigest.getInstance("SHA-1")
inputs.forEach { input ->
input.inputStream().use { stream ->
val buffer = ByteArray(8192)
while (true) {
val count = stream.read(buffer)
if (count < 0) break
digest.update(buffer, 0, count)
}
}
}
file.writeText(digest.digest().joinToString("") { "%02x".format(it) })
}

val lwjglVersion = "3.3.3"
group = "org.lwjgl.glfw"

Expand Down Expand Up @@ -83,8 +100,10 @@ tasks.jar {
from(excludedModulesFileList)
into(archiveFile.get().asFile.parentFile)
}
versionFile.writeText(System.currentTimeMillis().toString())
writeVersion(versionFile, listOf(archiveFile.get().asFile) + excludedModulesFileList)
}
outputs.file(versionFile)
outputs.files(excludedModules.map { path -> File(destinationDirectory.get().asFile, path) })
exclude("net/java/openjdk/cacio/ctc/**")
}

Expand Down
19 changes: 18 additions & 1 deletion LWJGL/3.4.1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
import java.security.MessageDigest

plugins {
java
}

fun writeVersion(file: File, inputs: List<File>) {
val digest = MessageDigest.getInstance("SHA-1")
inputs.forEach { input ->
input.inputStream().use { stream ->
val buffer = ByteArray(8192)
while (true) {
val count = stream.read(buffer)
if (count < 0) break
digest.update(buffer, 0, count)
}
}
}
file.writeText(digest.digest().joinToString("") { "%02x".format(it) })
}

val lwjglVersion = "3.4.1"
group = "org.lwjgl.glfw"

Expand Down Expand Up @@ -81,7 +98,7 @@ tasks.jar {
from(excludedModulesFileList)
into(archiveFile.get().asFile.parentFile)
}
versionFile.writeText(System.currentTimeMillis().toString())
writeVersion(versionFile, listOf(archiveFile.get().asFile) + excludedModulesFileList)
}
// Adds the jank to outputs
outputs.file(versionFile)
Expand Down
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-freetype.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-glfw.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-lwjglx.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-nanovg.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-openal.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-opengl.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-sdl.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-shaderc.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-spng.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-spvc.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-stb.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-tinyfd.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-vma.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl-vulkan.jar
Binary file not shown.
Binary file modified LWJGL/3.4.1/libs/3.4.1/lwjgl.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions LWJGL/3.4.1/src/main/java/org/lwjgl/glfw/CallbackBridge.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package org.lwjgl.glfw;
import java.nio.ByteBuffer;
import java.util.*;

public class CallbackBridge {
Expand All @@ -17,8 +18,13 @@ public class CallbackBridge {

public static final int ANDROID_TYPE_GRAB_STATE = 0;

public static final int SDL = 0;
public static final int INIT = 0;

public static final boolean INPUT_DEBUG_ENABLED;

public static boolean sGamepadDirectEnabled;

// TODO send grab state event to Android

static {
Expand All @@ -40,12 +46,21 @@ public class CallbackBridge {
}


public static void enableGamepadDirectInput() {
if (sGamepadDirectEnabled) return;
sGamepadDirectEnabled = nativeEnableGamepadDirectInput();
}

public static void sendData(int type, String data) {
nativeSendData(false, type, data);
}
public static native void nativeSendData(boolean isAndroid, int type, String data);
public static native boolean nativeSetInputReady(boolean ready);
public static native String nativeClipboard(int action, byte[] copy);
public static native void nativeSetGrabbing(boolean grab);
public static native boolean nativeNotifyLauncher(int type, int... action);
public static native boolean nativeEnableGamepadDirectInput();
public static native ByteBuffer nativeCreateGamepadButtonBuffer();
public static native ByteBuffer nativeCreateGamepadAxisBuffer();
}

69 changes: 43 additions & 26 deletions LWJGL/3.4.1/src/main/java/org/lwjgl/glfw/GLFW.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class GLFW
{
static FloatBuffer joystickData = (FloatBuffer)FloatBuffer.allocate(8).flip();
static ByteBuffer buttonData = (ByteBuffer)ByteBuffer.allocate(8).flip();
private static long gamepadDataPointer;
private static ByteBuffer gamepadButtonData;
private static FloatBuffer gamepadAxisData;
/** The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways. */
public static final int GLFW_VERSION_MAJOR = 3;

Expand Down Expand Up @@ -556,7 +559,7 @@ public class GLFW
public static boolean mGLFWIsInputReady;
private static boolean mGLFWInputPumping;
private static boolean mGLFWWindowVisibleOnCreation = true;
public static final ByteBuffer keyDownBuffer = ByteBuffer.allocateDirect(317);
public static final ByteBuffer keyDownBuffer = ByteBuffer.allocateDirect(318);
public static final ByteBuffer mouseDownBuffer = ByteBuffer.allocateDirect(8);

public static long mainContext = 0;
Expand Down Expand Up @@ -929,8 +932,10 @@ public static void glfwGetWindowFrameSize(@NativeType("GLFWwindow *") long windo
}

public static void glfwGetWindowContentScale(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("float *") FloatBuffer xscale, @Nullable @NativeType("float *") FloatBuffer yscale) {
if (xscale != null) xscale.put(1f);
if (yscale != null) yscale.put(1f);
if (xscale != null && yscale != null) {
xscale.put(1f);
yscale.put(1f);
}
}

@Nullable
Expand Down Expand Up @@ -1385,13 +1390,16 @@ public static int glfwGetKeyScancode(int key) {
}

public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) {
// This is jank, anything asking for int 348 results in an IndexOutOfBounds because idk.
// Probably an off-by-one error. This is the 'fix'
if (key == GLFW_KEY_LAST){return GLFW_KEY_LAST;}
return keyDownBuffer.get(Math.max(0, key-31));
if (key < 31 || key > GLFW_KEY_LAST) {
return 0;
}
return keyDownBuffer.get(key - 31);
}

public static int glfwGetMouseButton(@NativeType("GLFWwindow *") long window, int button) {
if (button < 0 || button >= mouseDownBuffer.capacity()) {
return 0;
}
return mouseDownBuffer.get(button);
}
public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") DoubleBuffer xpos, @Nullable @NativeType("double *") DoubleBuffer ypos) {
Expand Down Expand Up @@ -1444,51 +1452,60 @@ public static String glfwGetClipboardString(@NativeType("GLFWwindow *") long win
public static void glfwRequestWindowAttention(@NativeType("GLFWwindow *") long window) {
}

private static native long internalGetGamepadDataPointer();

private static void ensureGamepadBuffers() {
if (gamepadDataPointer == 0L) {
gamepadDataPointer = internalGetGamepadDataPointer();
gamepadButtonData = CallbackBridge.nativeCreateGamepadButtonBuffer();
gamepadAxisData = CallbackBridge.nativeCreateGamepadAxisBuffer().order(ByteOrder.LITTLE_ENDIAN).asFloatBuffer();
CallbackBridge.enableGamepadDirectInput();
}
}

public static boolean glfwJoystickPresent(int jid) {
if(jid == 0) {
return true;
}else return false;
return jid == 0;
}
public static String glfwGetJoystickName(int jid) {
if(jid == 0) {
return "AIC event bus controller";
}else return null;
return jid == 0 ? "Pojav XBOX 360 compatible gamepad" : null;
}
public static FloatBuffer glfwGetJoystickAxes(int jid) {
if(jid == 0) {
return joystickData;
}else return null;
if (jid != 0) return null;
ensureGamepadBuffers();
return gamepadAxisData;
}
public static ByteBuffer glfwGetJoystickButtons(int jid) {
if(jid == 0) {
return buttonData;
}else return null;
if (jid != 0) return null;
ensureGamepadBuffers();
return gamepadButtonData;
}
public static ByteBuffer glfwGetjoystickHats(int jid) {
return null;
}
public static boolean glfwJoystickIsGamepad(int jid) {
if(jid == 0) return true;
else return false;
if (jid != 0) return false;
ensureGamepadBuffers();
return true;
}
public static String glfwGetJoystickGUID(int jid) {
if(jid == 0) return "aio0";
else return null;
return jid == 0 ? "030000005e0400008e02000056210000" : null;
}
public static long glfwGetJoystickUserPointer(int jid) {
return 0;
}
public static void glfwSetJoystickUserPointer(int jid, long pointer) {

}
public static boolean glfwUpdateGamepadMappings(ByteBuffer string) {
return false;
}
public static String glfwGetGamepadName(int jid) {
return null;
return jid == 0 ? "Pojav XBOX 360 compatible gamepad" : null;
}
public static boolean glfwGetGamepadState(int jid, GLFWGamepadState state) {
return false;
if (jid != 0 || state == null) return false;
ensureGamepadBuffers();
memCopy(gamepadDataPointer, state.address(), state.sizeof());
return true;
}

/** Array version of: {@link #glfwGetVersion GetVersion} */
Expand Down
Loading