Using DDraw & D3D
I have searched the archives for threads on using DDraw and D3D. I found that a LOT of people ask this same question, and everyone has a different answer. I, too, looked at Microsoft''s documentation, and in DX7, found that they are based on the same type of surfaces. I know that to use DDraw you have to wait until the D3D device is done rendering. But does this slow it down that much, or at all?
I''m using D3D to draw a tile engine, akin to the article on GameDev a while back, so I don''t want to draw EVERYTHING with D3D, because I only need it to do the lighting for about 50-100 64x32 tiles, which should render pretty quick.
So, does anyone have a DIFINITIVE answer to this question?
If so, I''d LOVE to hear it.
Thanks in advance
Trajar
No definitive answer from me, but... if you''re going to the trouble of setting up D3D, I see no benefits in using any part of DirectDraw such as blitting to the backbuffer. Why not just load everything in as textures instead of normal surfaces? That way you are more likely to be able to take advantage of optimised drivers, etc. Maybe I''m missing something.
Because texture sizes need to be powers of 2 (ex. 8, 16, 32, 64, 256) and not all interface buttons/tool bars/sprites fall in these perfect dimesions.
Trajra
Trajra
I am currenlty working on an application that uses DirectDraw to write tiles and Direct3D to do the scene. I am using a Matrox G400 Max Video Card at 1024x768 (Pentium III 450 Mhz). When I profile the application, the Direct Draw routines only consume about 3-5% of CPU cycles at 85 fps. Now I''m only blitting 30 48x48 (16-bit color depth) tiles, but the performance seems reasonable. I have heard alot of talk about using overlays instead becuase apparently they perform much better under software rendering. I''m personally targeting my app towards 3d accelerators, so this isn''t a concern of mine. I''m new to DirectX programming, so I may find out later down the road that there are better methods for doing this. For now though, everything seems to be working well.
Corey
Corey
If you had a graphic 200 pixels across, what would be wrong with allocating a texture surface 256 pixels across and just leaving the 56 spare pixels transparent? Sure, this may seem wasteful, but then if you check the surface''s pitch for a 200 pixel wide DirectDraw surface it is often 256 anyway...
... or packing several sprites onto a large texture surface (as you might put several frames of animation onto one DirectDraw surface) and only using the relevant part of the texture by specifying the U,V values? Making what would essentially be an ''interface skin'' or something. In fact, could this not be ultra-efficient since you would minimize texture changes and you''d still be using a minimum of surfaces.
You''ll prolly be best off using as much D3D as possible, even though I''m not sure using DD and D3D will slow performance (I suggest you test that yourself).
The problem would be that, as Trajar said, textures needs to be power of 2 and preferably not bigger than 256x256 for compatibility. This will make it difficult to render interfaces (thinking of tiling up an interface with poly planes makes my skin crawl). I suggest you do some tests before you decide.
Kylotan: wouldn''t colorkeying be a waste of space and time (pixels that doesn''t exists has got to be faster than pixels that just isn''t drawn)?
============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
The problem would be that, as Trajar said, textures needs to be power of 2 and preferably not bigger than 256x256 for compatibility. This will make it difficult to render interfaces (thinking of tiling up an interface with poly planes makes my skin crawl). I suggest you do some tests before you decide.
Kylotan: wouldn''t colorkeying be a waste of space and time (pixels that doesn''t exists has got to be faster than pixels that just isn''t drawn)?
============================
Daniel Netz, Sentinel Design
"I'm not stupid, I'm from Sweden" - Unknown
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement