Sign in to follow this  
Emil_Halim

could DX9 and DX7 be mixed together

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
heeeeeeeh

it seems there is no way with D3d9, how did you know the colorkey of your Texture after you load it,also after you
load it, if you want to draw it to another Texture ,how can you keep the colorkey of each one as it is,
the problem is when you load the texture some proccesses have done to the alpha component ,it is
8 bit size ,of color and the colorkey of your image makes alpha = 0 ,so when you draw to this texture
you will change the alpha component, and this is the real problem. when you draw the last texture you
alrady lost it's colorkey.

thanks

Share this post


Link to post
Share on other sites
Why not use Direct3D7 with DirectDraw7?

The only reason for going back to DirectDraw7 would be to do some advanced pixel tricks - like the wipe effect in the original DOOM where you started a new level. God knows how this is done in DirectX9...

Share this post


Link to post
Share on other sites
after using DX9 i really do not want to go back to Direct3D7,because DX9 more
easly and have some power point that Direct3D7 ,but as you said DirectDraw7 gives you some tricks in pixel stuff, i already made some functions that
emulates a colorkey of DX7 , but it is done with CPU not GPU,and that is a weak point, so i am tring hardlly to mix DX9 with DX7.

so i am looking for any help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this