Metro DirectInput Sample?
-
2011年9月28日 上午 03:20
Hello:
I'm just starting to learn DirectX but I understand C++ okay. I get the basic idea behind the Direct2D Basic Animation sample and can move the triangle into alternate geometry paths, but I want to use the keyboard to control where the triangle goes.
- Which of the Metro Style App Samples best illustrates the ideal method to retrieve keyboard input via a Metro DirectX App?
- Which of the Metro Style App Samples best illustrates the ideal method to retrieve usb Sidewinder like [1] gamepad input via a Metro DirectX App?
If possible, I would rather avoid using hacks to access input devices.
Thanks,
Shawn
[1] - I'm sorry to see the Sidewinder joysticks/gamepads discontinued. They were in my mind the best joysticks ever made [ You can tell I haven't played games in a while...]
- 已編輯 Shawn Eary 2011年9月28日 上午 03:21
- 已編輯 Shawn Eary 2011年9月28日 上午 03:22
所有回覆
-
2011年9月28日 下午 04:59
There was a session at build about the different control mechanism: http://channel9.msdn.com/events/BUILD/BUILD2011/PLAT-754T
The slide contains code samples for different input devices. You would most likely have no luck with old joysticks and gamepads as Metro requires the usage of Xinput compatible devices in thios area.
-
2011年9月28日 下午 05:02版主
Here is a sample for keyboard and mouse input:
http://code.msdn.microsoft.com/windowsapps/Simple-Direct3D-111-Game-b18d89cb
and here is a sample for Xinput compatible devices (xbox controller is used in this one):
http://code.msdn.microsoft.com/windowsapps/Simple-XInput-Controller-77c4b8e5
Jeff Sanders (MSFT)- 已標示為解答 Shawn Eary 2011年9月30日 上午 04:07
-
2011年9月30日 上午 04:07
Even though I would like to go to the "Build" conference someday, I can't really afford it right now. I'm a web programmer in Oklahoma so I don't make as much money as some developers. Thanks for the link though. It's good to hear that Microsoft is moving onto a new API. With any luck for me, the new API will be easier. The keyboard API was easy enough.There was a session at build about the different control mechanism: http://channel9.msdn.com/events/BUILD/BUILD2011/PLAT-754T
You would most likely have no luck with old joysticks and gamepads as Metro requires the usage of Xinput compatible devices in this area.
That's really not a problem since the Xbox 360 Wired Controller appears to be selling at Walmart for a reasonable cost. Hopefully it uses a USB interface. Walmart says it works on PCs. It's good to know that Microsoft is still making Joysticks :-) I think Microsoft understands multimedia performance quite well. -
2011年9月30日 上午 04:29
Here is a sample for keyboard and mouse input:
http://code.msdn.microsoft.com/windowsapps/Simple-Direct3D-111-Game-b18d89cb
and here is a sample for Xinput compatible devices (xbox controller is used in this one):
http://code.msdn.microsoft.com/windowsapps/Simple-XInput-Controller-77c4b8e5
Jeff Sanders (MSFT)
Yeah, the first example is really good. I didn't have much time to play with this tonight, but I was able to hack the keyboard code of the MoveLookController from the Simple-Direct3D-111-Game into the Direct 2D Basic Animation example that I was playing with and move the triangle back and forth. If I can get some more time to play with this, I shouldn't be too far from a basic Asteroids game. I'll bet you're wondering why in the world a web programmer like myself doesn't just use Silverlight. I honestly don't know. When Windows 8 Developer Preview became available for download via the masses, something just drew me to DirectX. Maybe it's because the new Metro DirectX is supposed to be easier.BTW: I just found out tonight [1] that University of Oklahoma is looking for Video Game Programmers; unfortunately, I don't qualify at this time (maybe one of the readers here does):
- https://jobs.ou.edu/applicants/jsp/shared/position/JobDetails_css.jsp?postingId=250096 (Id subject to change)
- https://jobs.ou.edu/applicants/jsp/shared/position/JobDetails_css.jsp?postingId=250105 (Id subject to change)
- https://jobs.ou.edu/applicants/jsp/shared/position/JobDetails_css.jsp?postingId=250605 (Id subject to change)
[1] - The job listings could have been out there for a while. I just noticed them tonight because I was looking for a web developer job at OU [2]. The trouble is my transcript is a real work of "art"; unfortunately, I don't think I can claim Attention Deficit Disorder.
[2] - Another downer for me is that the web developers jobs at OU are looking for Flash Programmers, but I just know Silverlight using rudimentary WCF for data commo...
Note: I don't work for OU, but I wish I did. I, unfortunately, only have a Bachelor's degree and OU generally prefers staff (non-faculty) that have Master's degrees.
With Thanks to Mr. Sanders and Mr. Kornmann,
Shawn
-
2011年9月30日 上午 05:41
Even though I would like to go to the "Build" conference someday, I can't really afford it right now. I'm a web programmer in Oklahoma so I don't make as much money as some developers. Thanks for the link though. It's good to hear that Microsoft is moving onto a new API. With any luck for me, the new API will be easier. The keyboard API was easy enough.
This was not a advertisement for build. I would just give you a link to the recorded session and the slides for the talk about input.That's really not a problem since the Xbox 360 Wired Controller appears to be selling at Walmart for a reasonable cost. Hopefully it uses a USB interface. Walmart says it works on PCs. It's good to know that Microsoft is still making Joysticks :-) I think Microsoft understands multimedia performance quite well.
Standard wired Xbox 360 controllers works fine on the PC. Only special device could make some trouble. But they are normally part of the games that make use of them and not sell separated at stores.- 已編輯 Ralf Kornmann 2011年9月30日 上午 05:42
-
2011年9月30日 上午 05:49
I'll bet you're wondering why in the world a web programmer like myself doesn't just use Silverlight. I honestly don't know. When Windows 8 Developer Preview became available for download via the masses, something just drew me to DirectX. Maybe it's because the new Metro DirectX is supposed to be easier.
Slightly Off-Topic:
Silverlight 5 will support a somewhat scaled down version of XNA. XNA is a managed DirectX Version that can be used on Xbox 360, Windows Mobile 7 and the PC (but at least for now not for Metro apps). As it follows mostly the same principles you will be able to use most of your 3D knowledge you will get from DirectX although with Silverlight if you want.

