Jump to content
  • Advertisement

Archived

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

riz

using directDraw and direct3D together

This topic is 5898 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

Hey all, For a small game that a friend and I are writing, we want to provide an interface to the game (ie, new game, quit, etc). We were thinking of doing the interface in DirectDraw and then the game is a Direct3d game (sort of a 3d breakout). How is the interface normally created in industry, can you *mix* directdraw and direct3d and use them both in the game? Some high-level pseudocode would be much appreciated! regards, Riz

Share this post


Link to post
Share on other sites
Advertisement
You can mix them, but it is generally regarded as a bad idea because there is a cost associated with switching back and forth.

A better solution is to go full 3D and draw your UI as textured quads.

Share this post


Link to post
Share on other sites
IIRC, that''s how D3D 7 Immediate mode worked. Of course, it was built on top of DirectDraw, so i think you basically had to use them together.

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites
in the industry, textured quads as said are used. since you are just mapping the image data onto a rectangualar surface, its very similar to blitting. plus there is not much use of using directdraw just for the interface. especially if the game is being done in d3d.

cons of directdraw with d3d:
1. cards dont like switching back and forth. expensive time wise. any switch halts the cpu, forces the driver to flush the queue and then allows you to continue. furthermore, while doing a directdraw stuff, the gpu cant do anythign useful. ussually in a d3d app you send the vertex data through the api to the card with calls to Draw*Primitive() and they return almost instantly. the card then already starts drawing while the cpu is busy preparing the next set of data. for instance if you need to transform data, do some physics, etc.
2. d3d is using much of the availible vram, chunking things off for directdraw surfaces will get confusing and will be a managment nightmare.
3. by going only d3d you can use d3d8 which is MUCH cleaner and easier to use then d3d7.
4. all the benefits normally asscoiated with directdraw, cant be used effectivly with d3d. (ie direct pixel manipulation, since your at a higher res then you would be with directdraw, means more bandwidth, plus its SLOW to read from vram if you decide to do custom stuff with the video data.).

EDIT: removed stupid comment.

[edited by - a person on May 1, 2002 2:02:31 PM]

Share this post


Link to post
Share on other sites
sounds good...
now if we were going to use that same concept (textured quad in d3d) as a way to display information (such as score, etc.) in the same way as 3d shooter display information at the bottom (health, etc.), how would we do that? I''m confused as how to update the "texture" on the quad...

thanks,
riz

Share this post


Link to post
Share on other sites
just like you would normally do blits from a sprite surface. instead of blits, you use textured quads the correct uv coordinates. for things like health and other bars, you can just size the quad. i think you should read some of the 2d using d3d tutrials out there.

Share this post


Link to post
Share on other sites
quote:
Original post by a person
GarlandIX, and thats why you dont use immediate mode for anything except because its there.

Hmmm... Good point, except my video card doesn''t support d3d8.



------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites
If you would to do say a pixelarray[width*height], which i use with directDraw and copy to backbuffer each frame, how would I do that with d3d, set up a 2d vertice-buffer[width*height]???

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!