Re: Accessing a DirectDraw Interface in DirectX9

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Phil Taylor (ptaylor_at_private-citizen.com)
Date: 03/27/04


Date: Sat, 27 Mar 2004 08:24:37 -0800

you read the comment wrong.

functionality was missing in DX8 D3D,so methods were added in DX9 D3D. see

a.. 2-D Support. Added support for a color-converting blit between most
types of D3DPOOL_DEFAULT surfaces while using IDirect3DDevice9::StretchRect,
and a color fill operation for D3DPOOL_DEFAULT surfaces while using
IDirect3DDevice9::ColorFill.
a.. Microsoft Windows® Graphics Device Interface (GDI) Interoperability. Two
new methods have been added to get access to device contexts:
IDirect3DSurface9::GetDC and IDirect3DSurface9::ReleaseDC.

in the docs.

typically DX exposes hw capabilities. hw doesnt expose alpha to 2D, so DDraw
doesnt do it.

thats what the 3D pipeline is for.

the hw community has been innovating almost exclusively in the 3D pipeline,
so by staying in 2D you miss out on that. thats where progress is going.

there are plenty of articles out there on how to perform 2D in 3D.

the DPlay Maze sample loads textures from resources. so an example of how to
load from the resource fork exists.

when I read the D3DXCreateTextureFromFile docs, I see
The compiler setting also determines the function version. If Unicode is
defined, the function call resolves to D3DXCreateTextureFromFileW.
Otherwise, the function call resolves to D3DXCreateTextureFromFileA because
ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .jpg,
.png, and .tga.

so I see support for PNG. if you want it in DDraw, write a loader. I am
pretty sure you can google for a PNG loader. no SDK provides 100% of the
methods needed for 100% of the developers.

I suspect you can leverage the resource loading from DPlay Maze and eiither
use 3D methods and change the format; or write your own loader in 2D. have
you tried that?

"Paul" <Paul_Kappus@lvcm.com> wrote in message
news:CE0221F0-774E-4937-B187-E787FB9A6404@microsoft.com...
> Microsoft proclaimed that DirectDraw was back in DX9 so I thought maybe
they at least allowed you to get an interface in the standard C/C++ method
of programming.
>
> From my current understanding, developers are limited in there choices by
using the older SDK DX7 or using the managed methods in DX9 to access DX7
DirectDraw interface via wrappers.
>
> All I can say is what a bummer!
>
> First, why the heck didn't Microsoft complete the ALPHA BLENDING in
DirectDraw7? This has been a MAJOR problem for our project. Finally, we
have written our own assembly routinee to alpha blend in DirectDraw7 but it
has taken much research and if overused can sacrifice FPS. Recently, we
discovered a method to alpha blend in DirectDraw7 using the transform
factory but it requires loading PNG's which leads to the next major hurdle.
>
> Second, why the heck hasn't Microsoft allowed developers a method to load
PNG's as resources in the RC file rather than strictly offering a load from
file method. Does Microsoft think product developers freely distribute
their art files to the public along with the .EXE? I know, in addition to
the file load method, there is a stream method but not sure how it fits the
common use idea of loading from resources. It has been another tremedous
struggle to work with the "open source" community to seek out how to decode
PNG's. In other words, Microsoft is driving this C/C++ developer into the
hands of the enemy by not offering a reasonable method to load PNG's as
resources in DirectX7.
>
> So, looking to DX9 to solve some of our MAJOR road blocks and finding a
mixed bag offering little help and pointing us back to where we started
which is nearing a dead end.
>
> Thanks for the clarification on DirectDraw in DX9.
>



Relevant Pages

  • Re: Accessing a DirectDraw Interface in DirectX9
    ... need to support .NET directly. ... The regret is that Microsoft doesn't offer a valid ... There is one gaming ... DirectDraw graphics. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Surface is deprecated
    ... > I was surprise when i saw the surface class was deprecated. ... Note that the underlying DirectDraw ... Microsoft DirectX MVP ... reflect the official views of the Microsoft Corporation. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Surface is deprecated
    ... >> I was surprise when i saw the surface class was deprecated. ... Note that the underlying DirectDraw ... > Microsoft DirectX MVP ... > reflect the official views of the Microsoft Corporation. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Directdraw
    ... I was moaning about the fact that DirectDraw was not much different to DOS, ... I have never understood why Microsoft have not been able to: ... Make DirectDraw a proper 2D library with all the supporting graphics ... a real killer product, it does have the potential and it would make many ...
    (microsoft.public.win32.programmer.directx.graphics)
  • GetSurfaceFromDC not in ddraw.h ?
    ... I'm trying to load a file, then write directly to its surface using ... DirectDraw functions after it's loaded. ... GetSurfaceFromDC to get the DirectDraw surface associated with a file ...
    (microsoft.public.pocketpc.developer)