[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: spaceorb_3.jpg (20 KB, 350x272)
20 KB
20 KB JPG
retard here
why do gamedevs insist on using xinput when it's limited only to xbox-style gamepads? while directinput seems to support what frankenstein gamepad you throw at and will just detect any button as JOY1 JOY2 JOY3...JOY20..etc
directinput seems like it is far more flexible.
also according to wikipedia both are microsoft APIs, so what is the GNU/Linux equivalent?
>>
How do you think standards even come about?
Industry leaders settle on defacto standards and formalize them.
Now implement xinput in your linux game or nobody is gonna play it, scrub.
>>
>>107734091
Linux does use DirectInput or Xinput.
On Linux land people make native drivers.
Or use SDL.
>>
>>107734218
*Does NOT use
>>
>>107734091
We just use xinput and directinput or whatever through wine/proton.
Even if a game has a native linux version it rarely works anywhere as well as the windows version through proton.
>>
>>107734091
Because non-xbox (official + third party pads made for console use) controllers will default to non-dinput anyway, so you'd have to convert every single pad to dinput first and then bind the controls manually if the game fails to guess right. It also means the games would have to have controller remap support whereas thanks to xinput they can just not bother.
With xinput, any xinput pads or third party pads with an xinput mode can just werk OOB. There's nothing stopping devs from implementing dualshock, switch controller, or dinput support alongside it, but if they can't be arsed then then xinput is a no-brainer.
>>
360 controllers were really popular and became basically the standard for pc controllers for a period of time, only in recent years did directinput start making a comeback with people using playstation and other style controllers...
>>
>>107734364
>only in recent years did directinput start making a comeback
Isn't this because controller have more buttons now?
>>
>>107734380
not really, its mostly because of playstation and nintendo controllers, but im sure the newer stuff that have extra back buttons probably benefit a decent amount if they are not just used for macros/duplicating inputs
>>
>>107734091
Because DirectInput is harder to use.
Not only does it require the typical Windows callback boilerplate nonsense, the developers have to figure out each controller individually.
A DirectInput controller can have 6 axes, 2 sliders, 4 dpads (POV hats, technically), and 32 buttons. What do each of them do? How many does it even have? What sort of haptics does it support? That's up to the developer to figure out through a dozen different functions to query the device.
Every single button and axis on the pad is a unique Object which can only be understood by looking at its object instance struct:
typedef struct DIDEVICEOBJECTINSTANCE {
DWORD dwSize;
GUID guidType;
DWORD dwOfs;
DWORD dwType;
DWORD dwFlags;
TCHAR tszName[MAX_PATH];
DWORD dwFFMaxForce;
DWORD dwFFForceResolution;
WORD wCollectionNumber;
WORD wDesignatorIndex;
WORD wUsagePage;
WORD wUsage;
DWORD dwDimension;
WORD wExponent;
WORD wReportId;
} DIDEVICEOBJECTINSTANCE, *LPDIDEVICEOBJECTINSTANCE;

99% of games just want to know when the player pressed the damn A button, they don't want to write 500 lines of boilerplate to figure it out.
>>
File: 1747558885615890.png (608 KB, 1280x1280)
608 KB
608 KB PNG
>>107734091
both suck use SDL
>>
File: 1739396751487306.png (1.36 MB, 1011x1152)
1.36 MB
1.36 MB PNG
>>107734091
>>107734491
>not using GameInput API to make life harder for Lintards
>>
Linux has evdev and libinput as a wrapper on top of it. Though really you just want to use SDL.
>>
>>107734091
just read your devices with hidapi and programming your own
>>
>>107734218
>>107734491
>>107734614
SDL was the one that could also natively support DualShock 4 and DualSense + motion?
>>
>>107734364
>>107734412
Totally not because Xbox and Windows are both Microsoft and Xbox uses DirectX too.
>>
>>107734091
Two main reasons.
First, xbox 360/1/series controllers have a major limitation under directinput. The analogue triggers can't be read separately, only as one combined axis (-1 when holding LT and not holding RT, 1 when holding only RT, 0 when holding neither, also 0 when holding both). That's unacceptable for most games and it's the most popular brand of controller.
Second, by using xinput you can reliably and consistently refer to specific buttons. You know that when you check the A button you're checking the southmost of four face buttons. You also know that either it will physically have an "A" label on it, or that the player will probably know what you mean because they're familiar with how their controller maps to an Xbox pad. This is a lot better than guessing what directinput JOY10 means on a given pad.

But I agree with the other posters, new games should really use SDL3. It gives native support for basically every controller, decides on the best underlying API to use (including Steam Input when running under steam), supports playstation pads over both USB and Bluetooth while many AAA games only support them over USB (long story), and can read motion data for gyro aim etc.
>>
>>107734735 (Me)
Forgot to add, I'm convinced that the combined trigger thing was a deliberate limitation to force xinput adoption. I used to have a random directinput controller that had analogue triggers and they showed up separately just fine. Not every game could make sense of them but they were available for the few that could.
>>
>>107734691
sdl supports everything and its crossplatform. it makes using a wii remote easy for instance.
>>
>>107734091
>why do gamedevs insist on standardizing
to standardize
>>
>>107734855
but it seems like a shit standard.
half the fun in games is controls, and this xinput faggotry forces controller designers to only design xbox-style gamepads, whose to say there isn't a better design? say with a trackball instead of the right analog stick?
>>
>>107734364
>only in recent years did directinput start making a comeback with people using playstation and other style controllers...
Only because it became easier to wrap those inputs through to xinput, given most modern games don't support DirectInput that aren't sim titles.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.