Since you pretty much have to run a message pump in order to have a window, you might as well use that pump to handle keyboard and mouse input as well. It's entirely up to your pump whether you hand keyboard events on to a child window, you can handle them in the pump if you prefer. Of course, your actual pump will likely be even more complex than that, possibly with a MsgWaitForMultipleObjects so that you can wake periodically even if there a no messages to process, but immediatelly when there are messages.
DirectInput has been deprecated for good reasons. As fas as I know, it creates an extra thread and just queries Windows' Raw Input interface. For best performance, I'd use Raw Input directly. If performance is not an issue for you and I guess that's the case for a 2D game on current hardware , follow Microsoft's advice and use window messages, as described by John Knoeller. Since GetMessage blocks until a message is returned, so it can have a different return value.
If the game has a single window, than as far as I can tell the distinction is purely a matter of taste. If however, you have or are planning to have, or cannot positively rule out the option of having in the future multiple windows, then windows messaging can get tiresome. Yes, the MSDN post is correct. For the rest just use the windows messages.
If you are doing unprocessor intensive things such as waiting for a key from the user, collecting data from the user such as in a database or a tax program, or even a word processor, it makes sense just to use the Windows message with getmessage.
I the all the above programs date is the process when the user presses a key. All that the Windows message loop needs to process keys is for that program to be switched to. The mouse does not even need to be in the window. If you need to: 1 Know when a key is pressed and released.
You also may not want repeating keys detected as keypresses. If you're just collecting data from the user, then you will need to use the sleep command to suspend execution of the program. Use the sleep function putting the program to sleep until you want to poll direct input for keys. If however, you have or are planning to have, or cannot positively rule out the option of having in the future multiple windows, then windows messaging can get tiresome.
Yes, the MSDN post is correct. For the rest just use the windows messages. If you are doing unprocessor intensive things such as waiting for a key from the user, collecting data from the user such as in a database or a tax program, or even a word processor, it makes sense just to use the Windows message with getmessage.
I the all the above programs date is the process when the user presses a key. All that the Windows message loop needs to process keys is for that program to be switched to. The mouse does not even need to be in the window.
If you need to: 1 Know when a key is pressed and released. Topic Archived First Page 2 of 3 Last. Sign Up for free or Log In if you already have an account to be able to post messages, change how messages are displayed, and view media in posts. User Info: SilentHawk User Info: SilentCaay. Neither is intrinsically better. It depends on the game and how well each mode is supported. XInput is easier if the game is configured for it out of the box since it's a uniform control scheme for all gamepads that use it so you can just plug in your gamepad and go.
It also usually means more intuitive button prompts like "Press RT" instead of "Press 12" or whatever. However, DirectInput can be configured to work equally well and not all games are pre-configured for XInput. DirectInput gamepads can also emulate XInput in most cases so compatibility isn't usually an issue.
User Info: triple s. If you use a controller for most of your games, Xinput is undoubtedly better. User Info: RandPC. DirectInput has a MUCH broader feature set and can be used for as many inputs of whatever type as the designer can imagine.
Want 60 buttons? Need a flight stick, pedals, wheel etc? Then you use DirectInput. DirectInput will accomodate whatever you wish, it's entirely at the discretion of the peripheral manufactuer and software developers. It's also a deprecated standard, Microsoft will not provide any support for it and may remove it from the OS at any time. Let's say the mixer is on electrical circuit A and the electric guitar is plugged into a pedal board that's on electrical circuit B.
When the output line from the pedal board is connected to the stage jack and the audio cable is connected to the audio mixer, hum is heard in the system because you've connected the two grounds with different voltage levels. When this is the case, adding a ground isolator in the signal path is one way eliminate such system ground loop problems. It will use a transformer to step up or step down the voltage of the incoming signal to match the other. Another method, via a DI box, is to use the ground lift switch to "lift" the ground to break the loop.
This is a standard practice AS LONG AS the equipment on both ends is properly grounded - when the power cords have the third prong that's used for a ground. Ground loop problems can also occur because of damaged or loose components within a piece of equipment, such as a grounding wire working loose within an electric guitar or piece of rack equipment. Any time unexpected noise is heard, it's best to investigate and find out the reason.
Look at the two common low-frequency producing instruments, the piano keyboard and the bass. Yes, the lowest piano note competes with the bass at a whopping The problem is low frequencies, those under Hz, can overload passive DI boxes.
In such cases, active DI boxes are best. An active DI is a robust piece of equipment meant to not only convert the signal into a balanced one but to also alter the sound in some way. Have you ever heard of active and passive speakers? The difference is that active speakers are powered. In the same way, an active DI box requires power. They can be powered via a standard power outlet, batteries, or even phantom power. A note on the phantom power; they cannot pass the phantom power on, such as with a condenser microphone that requires phantom power.
The reason is that phantom power can only be passed on a balanced cable. These units can provide gain adjustments, EQ controls, mono and stereo inputs, tone shaping, just about whatever you can imagine. They can even offer a passthrough connector as a second output. This means it outputs the colored sound to the balanced cable but then passes an unaltered copy of the incoming signal to an output jack. This is usually called a bypass. A true bypass occurs when the signal goes straight from the input jack to the output jack with no circuitry involved and no loading of the source impedance.
However, due to the nature of electrical designs there is usually some slight change in the signal. The extent of change and how noticeable it is can vary widely from one brand to another. The best tool for the job is the tool that does what you need.
For example, there are a number of acoustic guitar active DI boxes that provide tone controls. That would be overkill. Active and passive are the two primary types. There are sub-types such as multimedia, digital, re-amp, and amp DIs. I hate this question. When comparing the low-priced to the high-priced passive DI boxes, there is a difference in the quality of the sound, namely a loss of quality in the mid-range frequencies.
A blind test showed this to be accurate. When it came to comparing the mid-priced to the high-priced passive DI boxes, that was a little tougher and I found, through testing, it depended on the quality of speakers or headphones I was using to listen to the samples. I don't have a link to that DI shootout darn if I can't find it but Sweetwater did one this year using a bass guitar and both passive and active DI boxes.
Therefore, consider these suggestions for common needs. If you like the sound you get from your DI, great, use it. However, I do suggest you borrow one of the below and swap to see if you get a better sound. If not, so be it. In audio, improvements often come in small increments. It even comes with an in-depth 7-page worksheet to help you along the way. Download the FREE. Audio Gear.
0コメント