java - Libgdx 1.2.0 Controller 扩展崩溃

标签 java input libgdx joystick

我最近刚刚更新到最新的 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/

相关文章:

java - 当我按下按钮时,为什么小程序中的球不移动?

java - 使用 Java 和 Netbeans 从我的数据库中选择计数

"Beans"的 JavaBeanBooleanPropertyBuilder 没有 setter

java - 从 intelliJ 中的 libgdx 项目生成可运行的 .jar 文件

java - Libgdx:如何删除表格中的边框

java - 根据另一个字符串的值确定一个字符串?

javascript - 如何将输入限制为数字 0-9?

javascript - WinJS 渲染 listview 时捕获事件

c++ - 从控制台读取字符串的不同方式实际上有何不同?运算符 <<、getline 还是 cin.getline?

java - GC_EXTERNAL_ALLOC 和 GC_FOR_MALLOC 日志消息每秒生成一次