Sign in to follow this  
MrJoshL

Cross-Distro DirectX Alternative For Linux?

Recommended Posts

MrJoshL    810

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.

Share this post


Link to post
Share on other sites
bubu LV    1436

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

Edited by Martins Mozeiko

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this