Jump to content

  • Log In with Google      Sign In   
  • Create Account


Using Direct3D in 2D...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Mike   Members   -  Reputation: 140

Like
Likes
Like

Posted 02 October 1999 - 09:36 AM

I would like to use Direct3D Immediate Mode in my 2D game in order to handle the alpha blending. I’m quite familiar with Direct Draw, but I’ve never used Direct3D. Generally speaking I would an outline as to what one would need to do in order to use Direct3D for alpha blending (and possibly light maps). Here is what I’ve got so far:

Setup

1. Of course I need to create all the global variables and include the needed libraries.
2. First I need to Create a direct draw object
3. Then create a primary surface
4. Now create a Direct3D object
5. Finnish Direct Draw setup (cooperative level, display mode, etc…)

Using it

1. Draw all Direct Draw stuff first.
2. Set the Direct3D object’s texture.
3. Call draw primitive (with the vertices that I’ve kept track of)

So far that is all I’ve pieced to gather. Do I really need to go through the trouble of setting up the view port and all the other 3D things if my only intent is to use Direct3D to draw an alpha blended primitive? I would appreciate any more information on the subject.


Sponsor:

#2 Pseudo   Members   -  Reputation: 100

Like
Likes
Like

Posted 02 October 1999 - 09:36 AM

I believe you still need to set up the viewport (in D3D 6.x) but the projection matrices don't really matter if you draw translated vertices. (D3DTLVERTEX) You can also skip the materials and lights with this vertex type. (you just specify the color with D3DRGBA(), but remeber the color values are from 0-1 for each component, ex. D3DRGBA(1,1,1,1) is white with full alpha)




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS