• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 927
  • Last Modified:

in directdraw.

I have two questions.

1.
  I'm using it for overlay.

  And input video singal format is yuy2.

  It works well.

  But there is one problem..

  The surface for overlay is always on the top.

  If a messagebox is appeared, it is always behind the
  surface..

  What's wrong ?
  and How can I display message box over overlay surface ?

//following source is what i used for creation

  ddsdYUV.dwSize = sizeof(ddsdYUV);
  ddsdYUV.dwFlags = DDSD_CAPS|DDSD_HEIGHT | DDSD_WIDTH |
                   DDSD_BACKBUFFERCOUNT | DSD_PIXELFORMAT;
  ddsdYUV.ddsCaps.dwCaps = DDSCAPS_OVERLAY | DDSCAPS_FLIP
                  | DDSCAPS_COMPLEX | DDSCAPS_VIDEOMEMORY;
  ddsdYUV.dwWidth = 640;
  ddsdYUV.dwHeight = 480;
  ddsdYUV.dwBackBufferCount = 1;
  ddsdYUV.ddpfPixelFormat = PixelFormatYUV;
  m_pDD->CreateSurface(&ddsdYUV, &m_pBufferYUV, NULL);

/////////////////////////////////////////////////////

2.
  I'm using YUY2 video format.
  I want to use RGB24 format.
  What are to be change for using RGB24 ?

Thanks.
0
can9999
Asked:
can9999
1 Solution
 
CJ_SCommented:
Indeed MessageBoxes will show up when you are using directdraw in fulscreen mode. That is why new version of windows (and the development environment) support the use of multiple monitors. When you are then running in fllscreen you can use the other monitor for debugging purposes. Windows cannot show the messagebox because DirectX needs full control over what is being placed on the screen...

Best way to go on about is to fetch the hDc of the primary surface (or the backbuffer before flipping surfaces), and using the API function TextOut to show a message.

In general, the question you are asking cannot be done when running in fullscreen mode.

To use 24 bits videosurfaces you have a couple of ways to do that, depending on the directx sdk verison you are using. For DirectX 7 you will need to define the PixelFormat. Create the structure and fill the datamembers, one of the variables needs to be filled with the 24 variable. I do not have the SDK at work but at home. For more detailed information you will have to wait for a while (if needed).

Please also note that a lot of new videocards do NOT suport the 24 bit anymore!

Regards,
CJ
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
NetminderCommented:
Per recommendation, points NOT refunded and question closed.

Netminder
EE Admin
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now