Cross-Distro DirectX Alternative For Linux?

Started by
1 comment, last by MrJoshL 10 years, 9 months ago

I have been programming with Xlib for X11 on free UNIX-like systems (Linux and BSD). I know that in all the stuff I have done with win32 that DirectInput is much more efficient than using the input/polling functions in win32 and MFC. Someone on a different forum said that you can just use the kernel headers, but they also said that you can't run those programs unless the user running them is root. This is obviously unacceptable for a game, as not all players can nor want to log in as root to play your game (especially suspicious since the game has a network component). So my question is best expressed as an analogy:

DirectInput:Windows :: x:Linux

Please help me by solving for x.

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.

Advertisement

DirectInput actually is not the most effective way of getting input on Windows. It is deprecated and nobody should be using it anymore.

On Windows you should use regular input/polling functions with standard windows message loop (GetMessage/PeekMessage and DispatchMessage) to process Raw Input messages. That will give you less latency than DirectInput.

On Linux you'll be fine with X11.

Of course you can access hardware directly, but as you said - you'll need root for that. To do that you'll need access /dev/input/* devices. Here's some info how:

https://www.kernel.org/doc/Documentation/input/input.txt

http://stackoverflow.com/a/3877020/675078

Thank you for that clarification. It is much appreciated.

C dominates the world of linear procedural computing, which won't advance. The future lies in MASSIVE parallelism.

This topic is closed to new replies.

Advertisement