DirectDraw expertise

Posted on 2002-07-27
Last Modified: 2013-12-03
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.

Question by:Marsc
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

fl0yd earned 350 total points
ID: 7183130
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...

Author Comment

ID: 7185693

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.


Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question