DirectDraw expertise

Hello experts....

Just trying to move my GDI program to DDraw....
I have some expertise about DSound,
About DDraw, I have some basic knowledge but never used it.

I know what a surface is for instances :-)

What I need is some that have used it before to guide me in some little problems I find in my way.

I create the DDSound object by a DirectDrawCreate() call.
Imediatly after I call the method:

DDraw->SetCooperativeLevel (hWnd, DDSCL_NORMAL);

Where hWnd is a Child window in my program (Where I want the DD action be developed).

1 - As far as I understand I can fip surfaces in a windowed mode of DDraw.... Well... No problem.... I blit from a secondary surface to the main surface....

2 - The doubt:
The next steep is SetDisplayMode.... But my doubt is that i am runing windowed.... I don't know what to do because as far as know, I can't change the display mode for a little portion of the screen....
I just want to create several back surfaces and then blitting them to the main surface using DIBs...
(As I do when I use GDI).
I assume that I will runing in a minimun of 800*600 true color system, or in other case windows will handle it.
Well... I need some detaled explanation about this....

3 - Next I need some detailed explanation about creating a surface that fits with the setted display mode.

After that... I guess I can create surfaces then start to blit them to the screen :-) If I miss something, please let me know...

Thanks In advance....

P.S: If I misspelled some name of call, method or constant, is just because I am away from my computer.

Who is Participating?
fl0ydConnect With a Mentor Commented:
2.) If in windowed mode you will have to use the same color depth as the desktop.

3.) pDD->CreateSurface( lpDDSurfaceDesc, (void**)&p_Surf, NULL )
You will have to fill the DDSURFACEDESC according to what you need the surface for. There are so many possible combinations that only you would know for sure which ones to use.

4.) You are missing something: Current version of DX is 8.1 :)
The reason why I'm mentioning this is that you shouldn't be using old versions. Especially, you should not be using those parts that are superseded by other API concepts and may receive less support in the future. DirectDraw is no more -- DX8 introduced DirectX Graphics. It's basically the Direct3D API with a few reminescent features of DirectDraw, such as IDirect3DDevice8::CopyRects and IDirect3DDevice8::CreateImageSurface. And like all new versions it got a facelift -- to be honest, it's more like a complete re-construction.

So why should you use DX8 when all you need is 2D features? Is it worth the hassle? I'd definately say: yes! A lot of tasks have been simplified - especially the creation of a Direct3D8-object. It can be done in one line of code. The flipping chain management has been greatly improved and simplified. It used to be hard to get it to work both in windowed and fullscreen mode. Finally you don't have to worry about it anymore. And the D3DX utility library is of great help if you need to get things going quickly. Loading an image (.png/.bmp/.jpg) and creating a texture is just one function call, to give you an example. This may not be important to you at the moment, but the DirectX Graphics API is likely to perform better on modern graphics hardware. To get started you can check out this tutorial: . If you decide to use DirectDraw after all you will also find a lot of tutorials on the same page and choose Programming->DirectX on the right.

p.s.: I'm currently developing an application that is to run on winnt 4.0 machines thus I need to use DirectX3 -- you don't happen to have a dx3 manual, do you? If you do, PLEASE LET ME KNOW. I've desperately searched both the microsoft page as well as the rest of the internet to no avail. If I didn't know any better I'd have to think that dx7 was the very first release of DirectX...
MarscAuthor Commented:

The link 
seems to be very helpful...
I started to figure it out about DirectX in general....
I still will use DirectDraw, yes, it seems to be a little obsolete, but I don't want to get into Direct3D without having understood DirectDraw first....
And I guess DirectDraw will not die tomorrow.... I guess It will be suported for next 2 years.... (I will be in other stage then).
For my next develope I will investigate Direct3D (And May be will be time to develope something 3D), but for now I am loking for inmediate solutions.
(Actually, the program could work perfectly using GDI, In fact it worked fine, just want to make some improvements that all are covered by DDraw).

In the other hand, I've changed mi mind.... I desided to go to an Exclusive coop level while the user is playing (Ohh yes... What I am doing is a game).

I am just exeperiencing some troubles to load bitmaps into surfaces.... Time to post some other question...

I don't have that manual, Actually, I live in Argentina, and as you might know since last january the currency was devaluated here.... The idea to buy books became impossible.... (Just thinking of taking advantage of the fact that I am an italian citizen, and moving to somewhere in Europe).
What I have is a DirectX8 SDK with some documentation.
But I guess you allready have that

Thank you very much.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.