Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DA, DD and DI questions

This topic is 5937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My first question is about DInput. I use it in my game so the player can enter his/her name for the highscore list. The problem however, is that DIK_Y and DIK_Z are wrong. When I hit y I get DIK_Z and vice versa. I assume this is the english keyboard layout but why? Does it depend on the directx runtime language? Or is it always like that and for european countries I have to switch both values manually? If so, how can I find out what language the windows version installed on a machine is? My other question is about DirectAudio. I know how to load a file and download it to the soundcard and how to play that segment. But how do I play multiple sounds at once? Well, I want to play the same sound/segment. So I first tell it to start playing. That works. But when I tell it to play again, then the first one stops and the new one begins. But don''t want the first one to stop. Do I really have to create another segment from the very same file to achieve what I want? How can I set transparency for a DirectDrawSurface? Thanks for the help.

Share this post

Link to post
Share on other sites
Okay, about DirectInput I know exactly what you''ve run into - I''ve had to deal with it as well...

Now, it happens that the DIK codes do NOT map to an actual character, but to the physical keyboard key. So if you''ve a french setup, your DIK_Q key will match the key A, the DIK_W match the key Z and so on...

The way to do it is this: Do NOT use DirectInput for typing names and text, period. To get the right chars according to locale, keyboard setup etc, one has to go through WM_CHAR windows messages, and perhaps a few APIs (haven''t researched that far yet).

You can make a search on the forum to learn more. For the directsound, sorry, can''t help you.

=^.^= Leaders and teachers should remember: It is best to offer others what they Need not what they Want.

Share this post

Link to post
Share on other sites
for typing text on a windows system, use the windows way...what Spacecat said is correct. and intercepting WM_CHAR will always get the correct letter no matter what key is what. if you wanna do that with dInput, you'll have to do a whole lotta "extra" programming.

as for dAudio

when you play a song that wants to be repeated...set it as a secondary segment like so

DirectMusicPerformance->PlaySegmentEx(DirectMusicSegment, 0,

just add DMUS_SEGF_SECONDARY for the 3rd parameter.

dunno about dDraw though....never used it

"For us it's a natural disaster....For him/she it's a damn memory leak..."
[Triple Buffer]|[SCRIPTaGAME]|[My Old Site]

[edited by - alfmga on September 16, 2002 4:12:16 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!