Solved

DirectDraw expertise

Posted on 2002-07-27
2
333 Views
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.

0
Comment
Question by:Marsc
2 Comments
 
LVL 8

Accepted Solution

by:
fl0yd earned 350 total points
Comment Utility
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: http://www.gamedev.net/reference/articles/article1434.asp . If you decide to use DirectDraw after all you will also find a lot of tutorials on the same page http://www.gamedev.net/reference/ 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...
0
 
LVL 1

Author Comment

by:Marsc
Comment Utility
fl0yd:

The link http://www.gamedev.net/reference/articles/article1434.asp
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.

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now