Archived

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

Spartacus

How to do 2D in DX8?

Recommended Posts

Spartacus    122
Hey! Apperently DirectDraw doenst exist in DirectX 8.0 so i would like to ask how can I then do 2D programming using DX8? Does Microsoft expect everyone to do 3D programming only or what? I dont know much about 3D and i would like to continue doing 2D programming for some time. Would there be anything wrong with continuing to use DirectDraw? -Thanks, -René

Share this post


Link to post
Share on other sites
SeanHowe    142
Nope, there''s nothing wrong with continuing to use DirectX7''s DirectDraw implementation. If you''re not comfortable with 3d, in fact, it''s probably your best choice. However, though, to answer your first question, 2d can be done in DirectX8, but it''s done like in OpenGL, with textured quads. (Also, there is a function similar to Blt, IDirect3DSurace8::CopyRects, but if you''re just going to use that there''s no point in not just staying wih DX7)

Share this post


Link to post
Share on other sites
Silent    122
_NEITHER_ is better. They are the same thing. MFC is Win32 wrapper classes. A tool for those that want to use it. MFC is a great thing for windows apps that need effort aimed more at the features and less on creating the framework and interface. I prefer Win32 API. This is mainly, because MFC, tho it is OO (and I love OOD), MFC makes it difficult to use the normal features of C++. I don''t like the idea of having to use MFC container classes over the STL.

Share this post


Link to post
Share on other sites
rk    122
quote:
Original post by Silent

_NEITHER_ is better. They are the same thing. MFC is Win32 wrapper classes. A tool for those that want to use it. MFC is a great thing for windows apps that need effort aimed more at the features and less on creating the framework and interface. I prefer Win32 API. This is mainly, because MFC, tho it is OO (and I love OOD), MFC makes it difficult to use the normal features of C++. I don''t like the idea of having to use MFC container classes over the STL.



Pleased to see I''m not the only confused person around here replying wrong threads.

rk applauds.

And about the original question, I''d like to say that using 3D for 2D stuff simply rocks. No way you could do things like alpha-blending and rotating as easily and fast as with 3D acceleration.



rk

Share this post


Link to post
Share on other sites
rk    122
Lol! Apparently I had replied to this thread TWICE... So I guess it makes me confused too. Well, edited the message to this.

rk blushes deeply.


rk


Edited by - rk on March 16, 2001 12:12:45 AM

Share this post


Link to post
Share on other sites
Xorcist    122
Okay I''m confused too, but somewhat differently. Maybe someone can help me out here... I''ve never used DirectX, but I planned to start learning this summer. Now if DirectX 8.0 doesn''t support DirectDraw how do older applications work, ones developed with...let''s say DirectX 6.0, on systems that have 8.0 installed. Also if DirectDraw was last available through version 7.0 and they''re already up to 8.0, how can I order a 7.0 version SDK. I ask because after reading this post I rushed over to Microsoft''s site to see if I could get a 7.0 SDK, but I only saw listings for 8.0. And I love 2D... a lot!!!!! Way more than 3D... Does this mean DirectDraw is dead? What am I gonna do... What am I gonna do!!!!!

Share this post


Link to post
Share on other sites
MatrixCubed    199
Well you need to comprehend the principles of COM. DirectX version 23 could be installed on a PC, but as long as Microsoft has adhered to COM all along, then DirectX 7 programs could be run on it. It all depends on what versions of the interfaces you''re using.

About using Direct3D8 for 2D operations... it does rock I''m using it in my isometric MMORPG, and it works very well for alpha, transparency, and multitexturing effects. Can''t wait to use it for ambient light sources



MatrixCubed
http://MatrixCubed.org

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Yeah, I''ve never done any COM work before... should I cover COM before I move into using DirectX, or will my learning DirectX teach me the basic COM principles? I want to make sure I learn things in the most logical order. As far as using Direct3D to perform 2D operations... is it easy, and will I be able to create, let''s say a full blown 2D platformer, using Direct3D? And if so, will my users be required to have 3D hardware to benefit from the Direct3D implementation? or in the case that they don''t will it all fall on software rendering? Maybe I''m still a bit confused... basically what are the differences between using DirectDraw and Direct3D when it comes down it. I mean I planned to learn DirectX specifically to create more advanced 2D platformers of the demo work I am doing now without DirectX. So what''s everyone''s advice?

Share this post


Link to post
Share on other sites
Some Guy    100
You probably should, as it'll all come together if you do. But what do I know...

"DARKNESS!
IMPRISONING ME,
ALL THAT I SEE,
ABSOLUTE HORROR!
I CANNOT LIVE,
I CANNOT DIE,
TRAPPED IN MYSELF,
BODY MY HOLDING CELL!

"LANDMINE!
HAS TAKEN MY SIGHT,
TAKEN MY SPEECH,
TAKEN MY HEARING,
TAKEN MY ARMS,
TAKEN MY LEGS,
TAKEN MY SOUL,
LEFT ME WITH LIFE IN HELL!"

--One by Metallica

Edited by - Some Guy on March 17, 2001 3:29:27 AM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
quote:

should I cover COM before I move into using DirectX, or will my learning DirectX teach me the basic COM principles?



You need to understand the "principles" of COM. That is, that it is backwards compatible (DX3 games work on DX8 machines). It is usefull for more, but not really for tetris games...


quote:

I rushed over to Microsoft''s site to see if I could get a 7.0 SDK, but I only saw listings for 8.0



I think you can type #define DX_VERSION 7.0 or something similar at the top of your header and DX8 will act like DX7. You then use the IDIRECTDRAW7 interfaces etc etc. Well... at least that''s what I used to do to make DX7 work like DX5 (to use andré''s books =)


quote:

As far as using Direct3D to perform 2D operations... is it easy, and will I be able to create, let''s say a full blown 2D platformer, using Direct3D?



D3D is very good for 2D work, as stated previously. All you really need to understand to get started is that instead of defining a sprite by having an X,Y coordinate and a Width and a Height (ala DDraw) you define it by it''s vertices (corners). It is not much of a change in logic, but you _do_ have to type different things to initialise it

Once you get a little more advanced, you will realise that you can do lots of stuff using simulated[i], DX8 2D, that wouldn''t be possible (at an acceptable speed) in DDraw, like alpha blending, billinear filtering for scaling, stretching (parralelograms - impossible in DDraw?) , rotation, ahh the list goes on =)


quote:

And if so, will my users be required to have 3D hardware to benefit from the Direct3D implementation? or in the case that they don''t will it all fall on software rendering?



Yes. If the user doesn''t have a 3D card, DX will simulate 3D emulation. It won''t be terribly fast, but seeing as Microsoft have fully paid coders working round the clock on this, the software engine is probably pretty good anyway.


Err.. i have probably confused more people than I have enlightened... but anyway... have fun!

Share this post


Link to post
Share on other sites