some simple Direct X questions

10-25-2001, 04:33 AM
I want to use direct x to improve the speed of my games
First I want to use directx to play normal sound wavs

Can u give me a very very simple example
And just post the code that is actually required and nothing else

also i want to use direct x to set a certain colour to be transparent...i heard that you use this with the blt..whatever its called that api call that everyone uses

10-25-2001, 07:08 AM
Right, here we go:

1) We have a DirectX forum for this, but thats not really important right now
2) I am going to write a DS tutorial today which will teach you the basics. I have already written a DirectMusic tutorial ( fpart=) which you might find useful.
3) BitBlt is an API call, not DirectX, and it can, if used correctly, make a certain colour of a picture transparent, using masking. Its Hand or VolteFace you'll want to ask about that
4) Using DirectX for your graphics would very easily allow you to make pictures transparent, and its the only method I recommend for fullscreen games. I suggest checking out my DirectDraw tutorial ( fpart=)

wild wolf
10-25-2001, 09:48 AM
hey Squirm, ill be waiting for ur DS tutorial, i have been looking for it all around but non were of any importance, when can u get it online?

10-25-2001, 09:54 AM
I've just posted it in Tutors Corner...... go check it out.

wild wolf
10-26-2001, 04:12 AM
i looked at ur tutroial (DirectSound), but iam getting some probs after implementing it:

1. It gave me an error on DX and then i realised that u had not defined DX so i defined it as Dim DX As New DirectX7 ( in the preferences i selected both DirectX7 & DirectX8). that solved the error. OK second error i get is on this line

Set DSBuffer = DS.CreateSoundBufferFromFile("E:\myfiles\cs\Project\project\hem6.wav", DSDesc, DSWave)

and i get an error on DSDesc : ByRef argument type mismatch (no idea what this error is)

the main thing i din know where to put in the code and since i wanted the music to play on form load so i put in the code in on form load sub. I dun know if iam doing the right thing coz i hardly know much on this topic but i learned alot from ur tutorial, thanx :)

10-26-2001, 08:09 AM
Well, as for your error, its hard to tell without seeing the rest of your code. If you would PM it to me please, rather than filling up this thread which was started by andrewo.

As for your problem about where to place it. I would suggest placing the initialising code into a new sub which is called on Form_Load, and then whenever you need to play the sound just put in the line:

<pre>DSBuffer.Play DSBPLAY_DEFAULT</pre>

PM me if you have any further problems please.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum