2D in DX

Started by
14 comments, last by vic_semionov 20 years, 3 months ago
quote:Original post by TempusElf
if I use only directdraw but compile with the libs and header files that came with DX9, what''s the runtime requirement for my game, DX7 or DX9?


You''ll be linking with the DX7 libraries and including the DX7 headers, so you''re game will require DX7.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
Advertisement
Just because DirectDraw isn''t in development still, that doesn''t mean you can''t use it. Since DircetX uses the COM architecture, you''ll always be able to use it by making calls to DirectDraw7. (Even if you''re using DirectX 9 or 8 or whatever you can still use functions from DirectX 7.)
=============================All knowledge is good; only the way it is put to use is good or evil.
You said you didn''t like having to use the 3D stuff when you could just use the 2D stuff, but in my humble opinion, once you see the difference (i.e. 1000 lines of code to initialize directdraw, 50 lines of code to initialize Direct3D, and very simple interfaces to use once you get the hang of it), I think you''ll be whistling a different tune. Give it a try, you''ll probably like it!

Chris
Chris ByersMicrosoft DirectX MVP - 2005
quote:Original post by Supernat02
1000 lines of code to initialize directdraw,


you must be exaggerating? My function that initializes DD is only 70 lines long and most of that is the standard windows init stuff. It takes only 30 lines for me to init DD, set up the primary surface and back buffer and that includes empty space lines, comments, and lines that only have braces on them.

the other thing that requires a lot of code is loading images. But that''s only because I opt not to use helper functions. I don''t think that should count toward initializing lines because I''ve noticed that without helper functions, it also takes a lot of code to load images/textures in Direct3D and OpenGL.
I''m exagerrating to an extent, but I''m also including checking device capabilities, setting up a clipper, changing the display mode to what the user requests, catching errors, resetting everything when the window loses focus, and other things that would be required in a game, all of which is implemented in a modular way...so it is a lot of code for me.

When I was doing direct draw, there was no load from file function included (that I could find). There was no copy from here to there included (that I could find). All of that was manual, without downloading third party functions, which I just don''t like to do. So that affects part of what I consider as more code. I should have said direct draw in general, not just the initialization.

I''m just thinking back when I used direct draw before and realizing that it is indeed easier to use D3D now. That''s my only point, whether it takes a thousand lines of code or not doesn''t matter much. It is easier to me, and I think Vic will find it easier in the long run. It will help him get into D3D, which he''ll probably start to work with afterwards anyway.

Good luck,
Chris

*Life is like the rock in a sling-shot. Pick a good target, take good aim, and get there as soon as possible!*
Chris ByersMicrosoft DirectX MVP - 2005
Its not so much what is easier or what is better, but what your wanting the requirements to be for your application.

If your targeting low end systems, because your application will not use any 3d or the effects that using D3D can give 2d engines, then you should definately use DirectDraw.

However, if you want your application to be only useable to those with 3d accel, then its better to move on with technology and get used to doing everything graphical 2d and 3d in Direct3D (DirectGraphics).

As for ease of use, I find both very easy to use, especially if you use the file ddutil.cpp and ddutil.h. It encapsulates the whole DirectDraw thing, or you can make your own like I did.

I dont believe you can use both DirectDraw and Direct3D in the same app, so keep that in mind.

This topic is closed to new replies.

Advertisement