我最近刚刚更新到最新的 Libgdx 并使用 Gradle 设置我的项目。其他一切似乎都正常,但我在尝试向游戏添加 Controller 支持时遇到了问题。当我尝试获取 Controller 或对 Controller 对象执行任何操作时,游戏崩溃并出现此错误。
Error creating joystick: Win32JoyStick::_initialize() >> failed to set cooperation level!
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000068904483, pid=2248, tid=716
#
# JRE version: Java(TM) SE Runtime Environment (8.0_11-b12) (build 1.8.0_11-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.11-b03 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [gdx-controllers-desktop64.dll+0x4483]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
AL lib: (EE) alc_cleanup: 1 device not closed
我在 Android/Desktop 的项目文件夹中看到了所有 Controller 依赖项,并指定我想要在设置 Gradle 项目时使用 Controller 扩展。我使用的是 PS3 Controller ,在其他游戏中运行良好。
大家有什么想法吗?
编辑:刚刚尝试使用 PS2 Controller 和 USB 适配器(不使用 xbox360 驱动程序)。与崩溃相同的问题。
最佳答案
通过更改我的 DesktopLauncher 类以不使用我的自定义 JFrame 来显示游戏来修复。您可以查看有关我最初更改此设置的原因的更多信息:https://stackoverflow.com/a/21731002/487578
这意味着我需要找到一种替代方法来解决我的其他问题。但我认为 Controller 支持比小错误重要得多。
关于java - Libgdx 1.2.0 Controller 扩展崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25216703/