could DX9 and DX7 be mixed together

Started by
13 comments, last by Emil_Halim 19 years ago
Hi all i know that my question my look like strange. could DX9 and DX7 be mixed together, so i create a normal DX9 device and then create DX7 Device,then draw from DX7 to DX9 ? my some one point me to use D3DXSprite , i know that, but i do want DX7 suff with DX9. if it could be ,please let me know. thanks for any help.
Advertisement
nope. all DX7 functionality is superceded by DX9 if you create a DX9 interface.
what could you possibly want to do with DX7 that you can't do with DX9?
some times you want to make 2d stuff, espcially with ColorKey just as DX7 does
,in your 3D world.

so i have an idea to make that , but i think some one else has a better one.

any way , my idea is

1- create DX9 device (back buffer ,......)
2- create Dx7 device (offScreenSurface,...)
3- to draw DX7_Surface to DX9_Backbuffer
a- Lock DX9_BackBuffer and get poiter to it , pitch
b- Do the same for DX7_Surface
c- with pointer & pitch you can copy your DX7_Surface to DX9_Backbuffer

so i can make that,but it is slow methoed , it rely on the CPU not GPU

any help ,please
You can do 2D stuff perfectly well in DX9.
how can you do 2D stuff perfectly well in DX9 ?

by using Texter or offscreenSurface with DX9,yes ,but they do not remember
ColorKey, correct me if i am wrong.
I'm not sure if color key has been completely removed, but you can always use an alpha channel if you're using textures. Alternatively, I think such a mix is possible within Visual Basic. Or maybe you can create a dll which uses DX7 and use DX9 in your main application. Or, even better, stick straight to D3D7.
Here there is a good example on how to use the D3DXSprite interface. I'm not sure of what does it do, but I think it's some replacement of the DD7 functions: http://www.codesampler.com/dx9src.htm
[ King_DuckZ out-- ]
many thanks to all of you guys , for tring help.
but as i mentioned befor, i know D3DXsprit , is not what i am looking for.

the problem is, with DX9 the Texture will not remember the colorkey after
you load or create it, it even has no colorkey at all,the colorkey is
proccess some way ,as may guys here toled me in old threads, when you load or create Testure.

there is many effect that can be done with colorkey,suppose you have 2 surface, srf1, srf2 , each one has it's own colorkey, ck1 , ck2.
with DX7 you can draw srf1 to srf2 ,bliiting, then draw srf2 to your screen.

so how could this be done in DX9..........

i hope that i have explaned my problem well.

help please
It sounds to me like you want to use DirectDraw, in which case the DirectX 9 gives you access to DirectDraw 9...which just happens to be renamed from DirectDraw 7. Nothing was actually changed.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
There is no DirectDraw 9. DirectDraw 7 is the last DirectDraw version there is and will ever be.

But it's still available for years (needed for backward compatibility).
The real problem is that accelerated directdraw supported has been going downhill for quite some time. Actually two generations ago cards (or drivers?) supported directdraw a lot better.

Basically, use directdraw 7, it is still there.
If you want the real power you may have to change to direct3d. This may be a bit nasty sometimes (esp. with colorkeying), but you could also load a texture several times with different colorkeys. Or load it once into memory and then use D3DXCreateTextureFromMemory.

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Quote:Original post by Emil_Halim
there is many effect that can be done with colorkey,suppose you have 2 surface, srf1, srf2 , each one has it's own colorkey, ck1 , ck2.
with DX7 you can draw srf1 to srf2 ,bliiting, then draw srf2 to your screen.

so how could this be done in DX9..........

i hope that i have explaned my problem well.

help please

Use D3DXCreateTextureFromFileEx() to specify a colour key for your two textures. That sets up an alpha channel which has binary alpha (either completely transparent or completely opaque). That colour key is remembered by the texture.
Then you can use the ID3DXSprite interface with alpha blending to draw things to the backbuffer with a colour key. Alternatively, you can use the IDirect3DSurface9 interface, and D3DXLoadSurfaceFromFile. But that is a bit of a pain since you need to create the surface first. I prefer to use Textures, and get the top-level surface from them.

You can also use IDirect3DDevice::UpdateSurface to bitblt one surface onto another, if you really need to.

Also, DirectDraw does not exist as IDirectDraw9. Microsoft discontinued it with DirectX 7. So it's no longer being supported, updated, or included in new SDKs with a different version number. The same with DirectPlay. If you need to use DirectDraw, you need to use DirectX 7. It's as simple as that. You can probably mix and match DX7 and DX9, by doing some really horrible stuff (deriving your own interfaces), but you really shouldn't need to.
Trust me, whatever you can do in DirectDraw, you can do faster in D3D.

This topic is closed to new replies.

Advertisement