예제 #1
0
int _glfwPlatformGetJoystickPos( int joy, float *pos, int numaxes )
{
    int i;

    // Is joystick present?
    if( !_glfwJoy[ joy ].Present )
    {
        return 0;
    }

    // Update joystick state
    pollJoystickEvents();

    // Does the joystick support less axes than requested?
    if( _glfwJoy[ joy ].NumAxes < numaxes )
    {
        numaxes = _glfwJoy[ joy ].NumAxes;
    }

    // Copy axis positions from internal state
    for( i = 0; i < numaxes; ++ i )
    {
        pos[ i ] = _glfwJoy[ joy ].Axis[ i ];
    }

    return numaxes;
}
예제 #2
0
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
{
    pollJoystickEvents();

    *count = _glfw->linux_js.js[joy].buttonCount;
    return _glfw->linux_js.js[joy].buttons;
}
예제 #3
0
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
{
    pollJoystickEvents();

    *count = _glfw->linux_js.js[joy].axisCount;
    return _glfw->linux_js.js[joy].axes;
}
예제 #4
0
int _glfwPlatformGetJoystickButtons( int joy, unsigned char *buttons,
    int numbuttons )
{
    int i;

    // Is joystick present?
    if( !_glfwJoy[ joy ].Present )
    {
        return 0;
    }

    // Update joystick state
    pollJoystickEvents();

    // Does the joystick support less buttons than requested?
    if( _glfwJoy[ joy ].NumButtons < numbuttons )
    {
        numbuttons = _glfwJoy[ joy ].NumButtons;
    }

    // Copy button states from internal state
    for( i = 0; i < numbuttons; ++ i )
    {
        buttons[ i ] = _glfwJoy[ joy ].Button[ i ];
    }

    return numbuttons;
}
예제 #5
0
const char* _glfwPlatformGetJoystickName(int joy)
{
    _GLFWjoystickLinux* js = _glfw.linux_js.js + joy;
    if (!pollJoystickEvents(js))
        return NULL;

    return js->name;
}
예제 #6
0
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
{
    _GLFWjoystickLinux* js = _glfw.linux_js.js + joy;
    if (!pollJoystickEvents(js))
        return NULL;

    *count = js->axisCount;
    return js->axes;
}
예제 #7
0
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
{
    _GLFWjoystickLinux* js = _glfw.linux_js.js + joy;
    if (!pollJoystickEvents(js))
        return NULL;

    *count = js->buttonCount;
    return js->buttons;
}
예제 #8
0
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
{
    pollJoystickEvents();

    if (!_glfw.x11.joystick[joy].present)
        return NULL;

    *count = _glfw.x11.joystick[joy].buttonCount;
    return _glfw.x11.joystick[joy].buttons;
}
예제 #9
0
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
{
    pollJoystickEvents();

    if (!_glfw.x11.joystick[joy].present)
        return NULL;

    *count = _glfw.x11.joystick[joy].axisCount;
    return _glfw.x11.joystick[joy].axes;
}
예제 #10
0
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numAxes)
{
    int i;

    pollJoystickEvents();

    if (!_glfwLibrary.X11.joystick[joy].present)
        return 0;

    if (_glfwLibrary.X11.joystick[joy].numAxes < numAxes)
        numAxes = _glfwLibrary.X11.joystick[joy].numAxes;

    for (i = 0;  i < numAxes;  i++)
        axes[i] = _glfwLibrary.X11.joystick[joy].axis[i];

    return numAxes;
}
예제 #11
0
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
                                    int numButtons)
{
    int i;

    pollJoystickEvents();

    if (!_glfwLibrary.X11.joystick[joy].present)
        return 0;

    if (_glfwLibrary.X11.joystick[joy].numButtons < numButtons)
        numButtons = _glfwLibrary.X11.joystick[joy].numButtons;

    for (i = 0;  i < numButtons;  i++)
        buttons[i] = _glfwLibrary.X11.joystick[joy].button[i];

    return numButtons;
}
예제 #12
0
int _glfwPlatformGetJoystickParam(int joy, int param)
{
    pollJoystickEvents();

    if (!_glfwLibrary.X11.joystick[joy].present)
        return 0;

    switch (param)
    {
        case GLFW_PRESENT:
            return GL_TRUE;

        case GLFW_AXES:
            return _glfwLibrary.X11.joystick[joy].numAxes;

        case GLFW_BUTTONS:
            return _glfwLibrary.X11.joystick[joy].numButtons;

        default:
            _glfwSetError(GLFW_INVALID_ENUM, NULL);
    }

    return 0;
}
예제 #13
0
const char* _glfwPlatformGetJoystickName(int joy)
{
    pollJoystickEvents();

    return _glfw->linux_js.js[joy].name;
}
예제 #14
0
int _glfwPlatformJoystickPresent(int joy)
{
    pollJoystickEvents();

    return _glfw.x11.joystick[joy].present;
}
예제 #15
0
int _glfwPlatformJoystickPresent(int joy)
{
    pollJoystickEvents();

    return _glfw->linux_js.js[joy].present;
}
예제 #16
0
const char* _glfwPlatformGetJoystickName(int joy)
{
    pollJoystickEvents();

    return _glfw.x11.joystick[joy].name;
}
예제 #17
0
int _glfwPlatformJoystickPresent(int joy)
{
    _GLFWjoystickLinux* js = _glfw.linux_js.js + joy;
    return pollJoystickEvents(js);
}