XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Render bitmap

Last post 03-17-2008 7:56 AM by Prog. 1 replies.
  • 02-26-2008 2:07 AM

    Render bitmap

    Hi,

    I need to render bitmaps really fast with great performance.
    Since I at the same time need to do other CPU demanding operations it is prefered if the rendering can be handled as much as possible by the graphics card. But the rendering must perform ok even if there is no 3D support in the graphics card.

    I have tried several rendering methods without coming to a conclusion.

    I have tried these methods:

    MFC:
    ----------------------------
    CDC::StretchDIBits
    CDC::StretchBlt
    CDC::BitBlt

    GDI:
    ----------------------------
    SetDIBitsToDevice

    DirectDraw:
    ----------------------------
    IDirectDrawSurface7::BltFast

    DirectX 9
    ----------------------------
    IDirect3DDevice9::SetTexture
    IDirect3DDevice9::StretchRect
    ID3DXSprite::Draw


    One method is by far fastest on all three systems I have tested with.
    The system setup is similar for all three, except for the graphics cards:
    Windows XP. service pack 2
    Intel Pentium D CPU 3.40 GHz, 2GB Ram
    The graphic cards differ accordingly:
    1. Matrox Millenium G550. 32MB
    2. Intel 82915. 128MB
    3. Geforce8600GT 256Mb

    The by far fastest rendering method is "IDirectDrawSurface7::BltFast".
    It is also the only method which is slowest on system 1 with the worst graphics card, and by far fastest on system 3 with the best card.
    Many of the other methods are worst on system 3, with the best graphics card!

    However, I'am not very happy with using an old method from DDraw7, when there should be methods which are faster and more optimized for new graphic cards in DirectX 9. Furthermore BltFast does not support resizing.

    But which method is this, that is best optimized for new graphics cards but also has good performance on computers with old graphics cards? And how do I use it to get the best performance and to minimize CPU usage, while letting the GPU do the work when supported by the graphics card?

    Thanks for all help!

     

     

  • 03-17-2008 7:56 AM In reply to

    Re: Render bitmap

    Hmmm, Just a thought how about detecting the cababilities of the card and using the render method which is most appropriate for it, although the code would be slightly larger you would get the best of both worlds.

    Avoiding direct X 7 if that was one of your tests could be difficult, the only suggestion I can think off there is to write your own routines to handle converting the bmp to raw data and then blatting that using bitblt instead.

    Good Luck :)

Page 1 of 1 (2 items) Previous Next