Results 1 to 10 of 10

Thread: XInput interface for Delphi

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    XInput interface for Delphi

    Hi all,

    I've just released my XInput interface for Delphi. Supports game pads only (limitation of the library). You can have the full complement of 4 pads connected, provides both eventing and polling style of use (or of course a combination of both). It's tested for Win32 and Win64 compilation using XInput1_3.dll. I've been unable to test using XInput1_4.dll as I don't have access to a Windows 8 platform. The only other thing that I've not been able to test is the battery monitoring capabilities for wireless controllers as I don't have one.

    If you find issues etc. please report them through GitHub's issue tracker.

    My library is available at:- http://smwl.uk/aoddl
    :: AthenaOfDelphi :: My Blog :: My Software ::

  2. #2
    Athena this is great...

    Tell me in which version's of delphi work and if work in lazarus/freepascal...?
    Is it possible to work in delphi 7?
    This library covers all the bluetooth devices... like xbox 360 controller or wiimote?

    Thank you and great work...
    P.S.. Give us some progress about the engine the team makes...

    Thank you

  3. #3
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    Hi,

    If the controller works with XInput, then I see no reason why they would not appear in the controller list. But, I only have a couple of XBox 360 wired pads for testing. Hence I only have constants etc. for the XBox 360 pads (as defined in the Microsoft XInput.h).

    Will it work with Delphi 7? It doesn't do anything fancy so it should work just fine. You will have to change the WinAPI.Windows and System.Types in the uses clause to Windows and Types respectively, but other than that it should work just dandy.

    Give it a whirl and let me know how you get on.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  4. #4
    Hello, at first I wanted to ask for help because I was having trouble getting the XInput library (unitXInput.pas) working with Delphi 2009, but when I looked in it the solution was really simple. So I'm sharing it if anyone would need it in the future.

    All you had to do is change uses:
    WinAPI.Windows -> Windows
    System.Types -> Types

    And add a new const:
    GUID_NULL: TGUID = '{00000000-0000-0000-0000-000000000000}';

    Also the example project "XInputTestbed" has too many errors so the best way is to create your own test application from scratch.

    It's nothing groundbraking but maybe someone will find it useful.

    And thanks for the library, it's working great!

  5. #5
    PGDCE Developer de_jean_7777's Avatar
    Join Date
    Nov 2006
    Location
    Bosnia and Herzegovina (Herzegovina)
    Posts
    287
    Awesome. This will be hugely helpful when I get around to implementing gamepad input Started it, but kinda stopped to do other things and left it in my pile of unfinished code.
    Existence is pain

  6. #6
    >XInput1_4.dll
    Oh, I didn't know 1.4 existed. Thank you for reminding me.
    My engine transparently supports 1.3 and 9.1.0
    I guess I'd have to buy a Xbox 360 controller headset to test it in full. Sigh.

  7. #7
    Now I have another problem and this time I can't find a solution. My application (using your xipnut library) is working alright under Windows 7 but when I run it under Windows 10, the xinput is not available (xinputAvailable=false) so I can't detect anything. I've tried compatibility modes and I've tried different xinput dll versions. Nothing works. Anyone knows where could be the problem? Or any ideas that I could test?

    Thank you.

  8. #8
    So I've traced the problem to this line:
    @fXIGetDSoundAudioDeviceGUIDS:=getProcAddress(fXIn putHandle,'XInputGetDSoundAudioDeviceGuids');
    The problem is that this will return nil and therefore the procedure TXInputInterface.initialise will return false. So I've removed all references to fXIGetDSoundAudioDeviceGuids in the unit and now it's working fine for buttons press detection.

  9. #9
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    Can I make a suggestion Go to the Github page for my library and create an issue recording what you've found out. I'm already looking at fixing it, but as usual Microsoft seem to have complicated things when it comes to figuring out which version of the OS you are running on.
    :: AthenaOfDelphi :: My Blog :: My Software ::

  10. #10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •