Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Cross-Distro DirectX Alternative For Linux?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Toothpix   Members   

810
Like
0Likes
Like

Posted 08 July 2013 - 08:13 PM

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.


#2 Martins Mozeiko   Members   

1436
Like
4Likes
Like

Posted 08 July 2013 - 09:31 PM

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, 08 July 2013 - 09:31 PM.


#3 Toothpix   Members   

810
Like
1Likes
Like

Posted 09 July 2013 - 05:13 PM

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.





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.