GLFW操纵杆输入问题
GLFW joystick input issues
我试图从GLFW的操纵杆(Thrustmaster Hotas x,如果它重要的话)获得输入,但使用glfwGetJoystickAxes和Buttons不像预期的那样工作。轴输出为00007FF77FC0D820,没有关于按钮状态的信息。我在这里做错了什么?
const float* Joystick::getAxesState()
{
axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &axesCount);
return axes;
}
const unsigned char* Joystick::getButtonState()
{
buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &buttonCount);
return buttons;
}
glfwGetJoystickAxes(<joystick>,<count>)
返回float[<count>]
数组
glfwGetJoystickButtons(<joystick>,<count>)
返回unsigned char[<count>]
数组
尝试使用<axes_return>[index]
和<buttons_return>[index]
访问它们。
也正如@Quentin提到的,你应该只调用这些函数一次,因为返回值是指向glfw内部存储状态的指针。
相关文章:
- cpp二进制搜索问题,计算给定数组中输入元素的出现次数
- 编写时C++中的输入重定向问题
- 输入std::数组时出现问题
- 我试图制作一个程序,要求用户输入问题和答案,但程序循环不正确
- 打印时有二叉树问题.用户输入不打印任何内容
- 用户输入字符串的文件附加问题..C++
- 我无法在Visual Studio代码中使用CIN输入答案,它说输入您的年龄,但它说只读文本编辑器如何解决这个问题?
- 遇到此问题时遇到困难:允许用户输入数组的值并使用 for,而循环也输出输入的最大数字
- C++模板编程设计问题 - 根据输入文件返回不同的类型
- 我应该如何在C++中使用结构体解决输入失败的问题?
- 我遇到使用 c++ 逐行读取输入文件的问题
- 在 2D 矢量中获取多个输入时出现问题
- 不确定出了什么问题(字符串输入)
- 在C++中读取 unicode 输入时出现问题
- 函数,从问题中获取输入,并在主函数中使用该输入
- c++中重载输入运算符的问题
- 通过终端在文件中输入时检测EOF(文件结束)时出现问题
- C ++回测问题:如何检查构造函数在假定失败时是否失败(给定输入的无效参数)
- 从标准输入读取多个类型时出现问题
- visual studio 2008 - c++问题输入